結果

問題 No.726 Tree Game
ユーザー Pachicobue
提出日時 2018-08-24 21:31:51
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 896 bytes
コンパイル時間 1,719 ms
コンパイル使用メモリ 194,832 KB
最終ジャッジ日時 2025-01-06 12:31:10
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

//=================================
// 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;
    };
    if (p(Y) or p(X)) { return (std::cout << "First" << std::endl), 0; }
    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;
}
0