結果
問題 |
No.726 Tree Game
|
ユーザー |
|
提出日時 | 2018-08-24 21:33:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 823 bytes |
コンパイル時間 | 1,717 ms |
コンパイル使用メモリ | 194,568 KB |
最終ジャッジ日時 | 2025-01-06 12:31:19 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 WA * 2 |
ソースコード
//================================= // Created on: 2018/08/24 21:23:14 //================================= #include <bits/stdc++.h> #define show(x) std::cerr << #x << " = " << x << std::endl using ll = long long; using ull = unsigned long long; using ld = long double; constexpr ll MOD = 1000000007LL; template <typename T> constexpr T INF = std::numeric_limits<T>::max() / 10; std::mt19937 mt{std::random_device{}()}; int main() { ll Y, X; std::cin >> Y >> X; int ans = 0; auto p = [](const ll n) { for (ll i = 2; i * i <= n; i++) { if (n % i == 0) { return false; } } return true; }; for (ll y = Y + 1; not p(y); y++) { ans++; } for (ll x = X + 1; not p(x); x++) { ans++; } std::cout << (ans % 2 == 1 ? "First" : "Second") << std::endl; return 0; }