結果

問題 No.1946 ロッカーの問題
ユーザー chineristACchineristAC
提出日時 2022-05-20 21:37:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 145 ms / 3,000 ms
コード長 498 bytes
コンパイル時間 999 ms
コンパイル使用メモリ 81,688 KB
実行使用メモリ 108,328 KB
最終ジャッジ日時 2023-10-20 11:59:48
合計ジャッジ時間 2,811 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
56,200 KB
testcase_01 AC 44 ms
56,200 KB
testcase_02 AC 88 ms
68,052 KB
testcase_03 AC 145 ms
108,328 KB
testcase_04 AC 91 ms
68,052 KB
testcase_05 AC 87 ms
69,420 KB
testcase_06 AC 88 ms
69,708 KB
testcase_07 AC 81 ms
69,132 KB
testcase_08 AC 84 ms
83,180 KB
testcase_09 AC 138 ms
106,252 KB
testcase_10 AC 130 ms
102,684 KB
testcase_11 AC 64 ms
69,204 KB
testcase_12 AC 84 ms
73,500 KB
testcase_13 AC 45 ms
56,200 KB
testcase_14 AC 45 ms
56,200 KB
testcase_15 AC 58 ms
65,244 KB
testcase_16 AC 47 ms
56,200 KB
testcase_17 AC 88 ms
83,752 KB
testcase_18 AC 128 ms
100,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict
import heapq
from itertools import permutations
from math import gcd

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

N,M = mi()
A = li()

door = [0] * (N+1)
for a in A:
    door[a] = 1

erai = [0] * (N+1)
for i in range(1,N+1)[::-1]:
    check = 0
    for j in range(2*i,N+1,i):
        if erai[j]:
            check ^= 1
    erai[i] = door[i]^check

print(N-sum(erai))
0