結果
問題 |
No.7 プライムナンバーゲーム
|
ユーザー |
|
提出日時 | 2021-12-18 17:46:07 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 438 bytes |
コンパイル時間 | 1,516 ms |
コンパイル使用メモリ | 165,456 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 13:50:20 |
合計ジャッジ時間 | 2,199 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 WA * 10 |
ソースコード
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using pii = pair<int, int>; bool f(int x) { if (x <= 1) return false; if (x == 2) return true; for (int i = 3; i <= x; i += 2) { if (x % i == 0) return false; } return true; } int main() { int n; cin >> n; if (f(n - 2) || f(n - 3)) cout << "Win" << endl; else cout << "Lose" << endl; return 0; }