結果

問題 No.1946 ロッカーの問題
ユーザー ikomaikoma
提出日時 2022-05-20 22:38:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 3,000 ms
コード長 298 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 81,768 KB
実行使用メモリ 126,124 KB
最終ジャッジ日時 2023-10-20 13:25:39
合計ジャッジ時間 2,750 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,364 KB
testcase_01 AC 38 ms
53,364 KB
testcase_02 AC 127 ms
90,788 KB
testcase_03 AC 148 ms
126,124 KB
testcase_04 AC 123 ms
90,728 KB
testcase_05 AC 107 ms
84,604 KB
testcase_06 AC 119 ms
87,168 KB
testcase_07 AC 104 ms
82,288 KB
testcase_08 AC 89 ms
86,820 KB
testcase_09 AC 153 ms
117,604 KB
testcase_10 AC 139 ms
115,248 KB
testcase_11 AC 55 ms
64,144 KB
testcase_12 AC 88 ms
78,692 KB
testcase_13 AC 38 ms
53,364 KB
testcase_14 AC 39 ms
53,364 KB
testcase_15 AC 52 ms
63,588 KB
testcase_16 AC 38 ms
53,364 KB
testcase_17 AC 76 ms
82,888 KB
testcase_18 AC 107 ms
103,608 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline


N,M=map(int,input().split())
A=set(map(int,input().split()))
ans=0
sabo = set()
for i in range(N,0,-1):
    l=0
    j=i
    while j<=N:
        if j not in sabo:
            l^=1
        j+=i
    if l ^ (i in A):
        ans+=1
        sabo.add(i)
print(ans)
0