結果
| 問題 |
No.7 プライムナンバーゲーム
|
| コンテスト | |
| ユーザー |
dgd1724
|
| 提出日時 | 2016-11-22 19:51:39 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 854 bytes |
| コンパイル時間 | 1,397 ms |
| コンパイル使用メモリ | 158,704 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-27 09:41:49 |
| 合計ジャッジ時間 | 1,934 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 10 |
ソースコード
#include <bits/stdc++.h>
//const static double de_PI = 3.14159265358979323846;
//const static double de_EPS = 0.000001;
//const static int de_MOD = 1000000007;
//const static int de_MAX = 999999999;
//const static int de_MIN = -999999999;
inline bool Judge_PrimeNumber(const int &a) {
if (a < 2) { return false; }
if (a == 2 || a == 3) { return true; }
if (a % 2 == 0) { return false; }
if (a % 6 != 1 && a % 6 != 5) { return false; }
for (int i = 5; i <= a / i; i += 2) {
if (a%i == 0) { return false; }
}
return true;
}
int main(void) {
//std::ifstream inf("123.txt"); std::cin.rdbuf(inf.rdbuf());
int N = 0;
std::cin >> N;
if (Judge_PrimeNumber(N - 2)) {
std::cout << "Win" << std::endl;
return 0;
}
if (Judge_PrimeNumber(N - 3)) {
std::cout << "Win" << std::endl;
return 0;
}
std::cout << "Lose" << std::endl;
}
dgd1724