結果

問題 No.1946 ロッカーの問題
ユーザー ntudantuda
提出日時 2022-10-24 21:12:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 173 ms / 3,000 ms
コード長 253 bytes
コンパイル時間 773 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 110,460 KB
最終ジャッジ日時 2023-09-15 22:49:52
合計ジャッジ時間 4,917 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,364 KB
testcase_01 AC 74 ms
71,100 KB
testcase_02 AC 132 ms
81,756 KB
testcase_03 AC 173 ms
110,460 KB
testcase_04 AC 127 ms
81,448 KB
testcase_05 AC 117 ms
80,780 KB
testcase_06 AC 123 ms
81,112 KB
testcase_07 AC 113 ms
80,316 KB
testcase_08 AC 110 ms
86,864 KB
testcase_09 AC 156 ms
106,700 KB
testcase_10 AC 145 ms
102,848 KB
testcase_11 AC 89 ms
76,760 KB
testcase_12 AC 109 ms
80,168 KB
testcase_13 AC 74 ms
71,044 KB
testcase_14 AC 72 ms
71,284 KB
testcase_15 AC 90 ms
77,412 KB
testcase_16 AC 78 ms
71,188 KB
testcase_17 AC 118 ms
87,520 KB
testcase_18 AC 153 ms
100,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int, input().split())
A = list(map(int, input().split()))
P = [0] * (N+1)
B = [0] * (N+1)
for i in A:
    P[i] = 1
cnt = 0
for i in reversed(range(1,N+1)):
    if sum(B[::i]) & 1 != P[i]:
        B[i] = 1
    else:
        cnt += 1
print(cnt)
0