P1161 开灯(python3实现)
作者:互联网
"""
P1161 开灯(python3实现)
https://www.luogu.com.cn/problem/P1161
"""
a=[0]*2000001
n=int(input())
for i in range(1,n+1):
x,y=map( float,input().split() )
for j in range(1,int(y+1) ):
if a[int(j*x)]==0:
a[int(j*x)]=1
else:
a[int(j*x)]=0
i=1
while 1:
if a[i]==1:
print(i)
break
i+=1
标签:int,开灯,range,P1161,input,python3 来源: https://blog.csdn.net/dllglvzhenfeng/article/details/122807487