結果

問題 No.726 Tree Game
ユーザー chocobochocobo
提出日時 2018-08-25 00:55:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,361 bytes
コンパイル時間 1,888 ms
コンパイル使用メモリ 94,816 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-05 21:37:01
合計ジャッジ時間 2,673 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>


using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)



int main() {
    ll y, x;
    cin >> y >> x;

    ll a;
    if(y > 2){
        for(a = y + 1;; a++){
            ll i;
            for(i = 2; i <= ceil(sqrt(a)); i++){
                if(a % i == 0){
                    break;
                }
            }
            if(i == ceil(sqrt(a)) + 1){
                break;
            }
        }
    }
    else{
        a = y + 1;
    }
    
    ll b;
    if(x > 2){
        for(b = x + 1;; b++){
            ll i;
            for(i = 2; i <= ceil(sqrt(b)); i++){
                if(b % i == 0){
                    break;
                }
            }
            if(i == ceil(sqrt(b)) + 1){
                break;
            }
        }
    }
    else{
        b = x + 1;
    }

    if(((a - y - 1) + (b - x - 1)) % 2 == 0){
        cout << "Second" << endl;
    }
    else{
        cout << "First" << endl;
    }
}
0