时间显示(100)
p=['00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24','25','26','27','28','29',
'30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48',
'49', '50', '51', '52', '53', '54', '55', '56','57','58','59' ]
n=int(input())
n=int(n/1000)
h=int(n/3600)%24
m=int((n%3600)/60)
s=n%3600%60
print(p[h],end='')
print(':',end='')
print(p[m],end='')
print(':',end='')
print(p[s])
忘了怎么用列表将1转换为01了
砝码称重(不会,看的思路,70)
#砝码(70)
n=int(input())
l1=list(map(int,input().split()))
l2=[]
l3=[]
l2.append(l1[0])
for i in l1[1:]:
for p in l2:
if p not in l3:
l3.append(p)
if i not in l3:
l3.append(i)
if i+p not in l3:
l3.append(i+p)
if abs(p-i) not in l3 and abs(p-i)!=0:
l3.append(abs(p-i))
for i in l3:
if i not in l2:
l2.append(i)
print(len(l3))