난 정말 최고야 멋있어
CTFLearn - Simple Programming 본문
https://mega.nz/#!7aoVEKhK!BAohJ0tfnP7bISIkbADK3qe1yNEkzjHXLKoJoKmqLys
MEGA
MEGA provides free cloud storage with convenient and powerful always-on privacy. Claim your free 50GB now
mega.nz
위의 파일에서
0이 3의 배수만큼 있거나 1이 2의 배수만큼있는 줄들의 수를 구하면 된다
간단한 파이썬 스크립트를 짜면 손쉽게 해결 가능하다
f = open('data.dat') ll = f.readlines() count=0 for i in ll: c0=0 c1=0 for j in i: if j == '0': c0 += 1 elif j == '1': c1 += 1 if c0%3==0 or c1%2==0: count+=1 print(f'flag : {count}') f.close() |
flag : 6662