“Hitung kompleksitas waktu online” Kode Jawaban

Hitung kompleksitas waktu online

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

Hitung kompleksitas waktu online

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

Hitung kompleksitas waktu online

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

Hitung kompleksitas waktu online

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

Hitung kompleksitas waktu online

# 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)

Hitung kompleksitas waktu online

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

Jawaban yang mirip dengan “Hitung kompleksitas waktu online”

Pertanyaan yang mirip dengan “Hitung kompleksitas waktu online”

Lebih banyak jawaban terkait untuk “Hitung kompleksitas waktu online” di Python

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya