-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideo1.txt
More file actions
34 lines (25 loc) · 834 Bytes
/
Copy pathVideo1.txt
File metadata and controls
34 lines (25 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Programación: Es la disciplina del software.
Software: Aplicaciones, soporte lógico del dispositivo
Hardware: Componentes Físicos.
Videosjuegos -> Sistemas Operativos
Lenguaje de Programación: Sintaxis.
Algoritmo: Conjunto Fínitos de Pasos.
Eficiencia: Para poder medir que los algoritmos, debemos medir con su función t1 = time()
t2 = time()
print(t2-t1) #Es el tiempo de ejecución del programa.
from time import time
t1 = time()
a = open("Entrada.txt", "r")
l = []
for line in a:
suma = 0; p = line.strip("\n")
for i in p:
suma += int(i)
if(suma > 36): break # Sin este algoritmo tardo 17.83 segundos
if (suma == 36): l.append(int(p))
l.sort()
print(l[len(l)-1])
t2 = time()
print(t2-t1)
#Tardo total 3.90 segundos
Python reutilizar códigos, para poder implementar más funciones, sin tenerlo en un archivo.