結果
問題 |
No.1946 ロッカーの問題
|
ユーザー |
![]() |
提出日時 | 2022-05-20 21:54:49 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 609 ms / 3,000 ms |
コード長 | 333 bytes |
コンパイル時間 | 87 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 34,520 KB |
最終ジャッジ日時 | 2024-09-20 07:59:30 |
合計ジャッジ時間 | 6,261 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 |
ソースコード
N, K = map(int, input().split()) A = list(map(int, input().split())) S = set(A) sabo = [0] * (N + 1) for i in reversed(range(1, N+1)): c = (N // i) % 2 for j in range(i, N+1, i): c ^= sabo[j] if i in S and c == 1: continue if not i in S and c == 0: continue sabo[i] = 1 print(sum(sabo))