結果
問題 |
No.7 プライムナンバーゲーム
|
ユーザー |
![]() |
提出日時 | 2018-12-30 16:30:51 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 812 bytes |
コンパイル時間 | 1,020 ms |
コンパイル使用メモリ | 93,848 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-07 19:41:04 |
合計ジャッジ時間 | 1,469 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 WA * 15 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <set> #include <cmath> #include <stack> #include <algorithm> #include <iomanip> #include <map> #include <queue> #include <functional> #include <numeric> using ll = long long; using namespace std; const ll MOD = 1e9 + 7; vector<int> prime; bool sieve[200010]; int key[100010]; int Hash[55]; int main(void) { int N; cin >> N; for (int i = 0; i < 10010; ++i) sieve[i] = true; sieve[0] = sieve[1] = false; for (int i = 2; i * i < 10010; ++i) { if (sieve[i]) { for (int j = 2; i * j < 10010; ++j) { sieve[i * j] = false; } } } if (sieve[N - 2]) cout << "Win" << endl; else cout << "No" << endl; return 0; }