“Calculer la complexité du temps en ligne” Réponses codées

Calculer la complexité du temps en ligne

N=int(input()) #1
prod=1          #2
summ=0          #3
	
while N>0:     #6 
	prod=prod*(N%10)  #no of digts-n 
	summ=summ+(N%10)  #n
	N=N//10             #n
d=prod-summ #4

print(d) #552
#total =3n+6===orde will be  3n that is O(N) 123---9/
Yellowed Yacare

Calculer la complexité du temps en ligne

def main():
    time1 = input()
    time2 = input()
    hh_time1 = int((time1.split(' '))[0])
    mm_time1 = int((time1.split(' '))[1])
    hh_time2 = int((time2.split(' '))[0])
    mm_time2 = int((time2.split(' '))[1])
    if hh_time1 <= 23 and hh_time1 >= 0 and hh_time2 <= 23 and hh_time2 >= 0 and mm_time1 <= 59 and mm_time1 >= 0 and mm_time2 <= 59 and mm_time2 >= 0:
        new_mm_time=mm_time1+mm_time2
        if new_mm_time >=60:
            new_mm_time = new_mm_time - 60
            count = 1
        else:
            count=0
        new_hh_time=hh_time1+hh_time2+count
        if new_hh_time >=24:
            new_hh_time = new_hh_time - 24
        print(str(new_hh_time).zfill(2) +" " + str(new_mm_time).zfill(2),end="")
main()
Manoj kumar sahoo

Calculer la complexité du temps en ligne

 print ("hi")
 x=3
 y=19
 z=x+y
 print("z=",z)
sozan mohammed

Calculer la complexité du temps en ligne

print("--------Function showAll --------")
        print("Total no. of cargo flights: "+str(self.flights.__len__()))
        print("Total no. of airports: "+str(self.airportsArray.__len__()))
        print("List of Cargo flights:")
        for t in self.flights:
            print(t)
        for t in self.airportsArray:
            print(t)
        print("\n\n")
Anxious Albatross

Calculer la complexité du temps en ligne

# Your code here
enter = input("")
l= enter.split()
M=int(l[1])
N=int(l[0])
if((N>=2 and N<=10**6) and (M>=2 and M<=min(N,100))):
    l_M=[]
    for i in range(1,M+1):
        weight= int(input(""))
        if(weight>=1 and weight<=5000):
            l_M.append(weight)
    # maxi_d=
    # for i in range(1 , min(N+1,101)):
    #     for k in range(i , min(N+1,101)):
    #         for j in range(1,M+1):
    #             l=abs(())
    maxi=abs((0-1)*(l_M[0]*l_M[1]))
    print("maxi: ", maxi)
    for t in range(1, min(N+1 , 101)):
        for p in range(t, min(N+1 , 101)):
            for i in range(1,M+1):
                for j in range(i+1,M+1):
                    k= abs((t-p)*(l_M[i-1]*l_M[j-1]))
                    if(k>=maxi):
                        maxi = k
    print(maxi)
Drishti Agrawal (B21CS027)

Calculer la complexité du temps en ligne

def main():
    i=0
    while i<10:
        print('hello')
        i+=1
        for j in range(10):
            print('ciao')
main()
Social Club

Réponses similaires à “Calculer la complexité du temps en ligne”

Questions similaires à “Calculer la complexité du temps en ligne”

Plus de réponses similaires à “Calculer la complexité du temps en ligne” dans Python

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code