凶猛的小白兔

关注

P1161 开灯(python3实现)

凶猛的小白兔

关注

阅读 96

2022-02-07

开灯 - 洛谷

"""

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



相关推荐

上善若水的道

P1161 开灯

上善若水的道 78 0 0

雨鸣静声

P1100 高低位交换(python3实现)

雨鸣静声 70 0 0

Sky飞羽

P1255 数楼梯 方法一(python3实现)

Sky飞羽 94 0 0

陈情雅雅

P1423 小玉在游泳(python3实现)

陈情雅雅 109 0 0

就是耍帅

P1880 [NOI1995] 石子合并(python3实现)

就是耍帅 73 0 0

魔都魅影梅杜萨

P1422 小玉家的电费(python3实现)

魔都魅影梅杜萨 55 0 0

gy2006_sw

P1888 三角函数(python3实现)

gy2006_sw 46 0 0

googlefrank

P1876 开灯[洛谷]

googlefrank 34 0 0

f12b11374cba

P1424 小鱼的航程(改进版) -- python3实现

f12b11374cba 59 0 0

慕犹清

python3实现线程池

慕犹清 58 0 0

精彩评论(0)

0 0 举报