Programming/Python & Data Structures
[Baekjoon/Python3] 6359번 만취한 상범
HooNeee
2020. 12. 5. 21:48
[Baekjoon/Python3] 6359번 만취한 상범
6359번: 만취한 상범
한 줄에 한 개씩 각 테스트 케이스의 답, 즉 몇 명이 탈출할 수 있는지를 출력한다.
www.acmicpc.net
t = int(input())
for i in range(t):
n = int(input())
room = [False for r in range(n + 1)]
for j in range(1, n + 1):
for k in range(1, n + 1):
if j * k <= n:
room[j * k] = not bool(room[j * k]) # not bool
else:
break
print(room.count(True))