結果

問題 No.1946 ロッカーの問題
ユーザー 👑 rin204rin204
提出日時 2022-05-20 21:39:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,036 ms / 3,000 ms
コード長 382 bytes
コンパイル時間 900 ms
コンパイル使用メモリ 81,536 KB
実行使用メモリ 107,836 KB
最終ジャッジ日時 2023-10-20 12:04:20
合計ジャッジ時間 6,432 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,604 KB
testcase_01 AC 38 ms
53,604 KB
testcase_02 AC 44 ms
58,860 KB
testcase_03 AC 830 ms
107,836 KB
testcase_04 AC 42 ms
58,860 KB
testcase_05 AC 68 ms
65,780 KB
testcase_06 AC 70 ms
65,924 KB
testcase_07 AC 65 ms
65,636 KB
testcase_08 AC 221 ms
82,752 KB
testcase_09 AC 711 ms
103,908 KB
testcase_10 AC 577 ms
100,336 KB
testcase_11 AC 65 ms
68,756 KB
testcase_12 AC 142 ms
72,372 KB
testcase_13 AC 37 ms
53,436 KB
testcase_14 AC 37 ms
53,436 KB
testcase_15 AC 41 ms
57,624 KB
testcase_16 AC 36 ms
53,604 KB
testcase_17 AC 406 ms
84,040 KB
testcase_18 AC 1,036 ms
97,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
A = list(map(int, input().split()))
open = [False] * (n + 1)
for a in A:
    open[a] = True
ans = 0

for i in range(n, 0, -1):
    if not open[i]:
        ans += 1
        continue
    for j in range(1, int(i ** 0.5 + 1)):
        if i % j == 0:
            open[j] ^= True
            if j * j != i:
                open[i // j] ^= True
print(ans)
0