Notice
Recent Posts
Recent Comments
Link
«   2024/09   »
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
Tags more
Archives
Today
Total
관리 메뉴

난 정말 최고야 멋있어

CTFLearn - Simple Programming 본문

카테고리 없음

CTFLearn - Simple Programming

n00bh4cker 2019. 12. 12. 15:24

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의 배수만큼있는 줄들의 수를 구하면 된다

 

간단한 파이썬 스크립트를 짜면 손쉽게 해결 가능하다

= 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