結果

問題 No.7 プライムナンバーゲーム
ユーザー icchiposticchipost
提出日時 2021-12-18 17:46:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 438 bytes
コンパイル時間 1,433 ms
コンパイル使用メモリ 164,316 KB
実行使用メモリ 4,476 KB
最終ジャッジ日時 2023-10-13 17:59:14
合計ジャッジ時間 2,482 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,356 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
4,352 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
4,352 KB
testcase_10 AC 1 ms
4,352 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0