結果
問題 |
No.1946 ロッカーの問題
|
ユーザー |
![]() |
提出日時 | 2023-06-29 14:23:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 413 bytes |
コンパイル時間 | 1,862 ms |
コンパイル使用メモリ | 195,640 KB |
最終ジャッジ日時 | 2025-02-15 03:04:25 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 5 WA * 14 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ ll N, M, c, ans=0; cin >> N >> M; vector<ll> cnt(N+1), open(N+1); for (int i=1; i<=M; i++){ cin >> c; open[c] = 1; } for (int i=1; i<=N; i++){ if (open[i] != (cnt[i]+1) % 2) ans++; else for (int j=i; j<=N; j+=i) cnt[j]++; } cout << ans << endl; return 0; }