結果

問題 No.726 Tree Game
ユーザー weizenweizen
提出日時 2018-08-30 11:35:25
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 127 ms
コンパイル使用メモリ 25,756 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-11 20:56:44
合計ジャッジ時間 1,701 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int Y,X;
char isPrime(int a){
        for(int k = 2; k*k <= a; k++)
                if(a%k==0) return 1;
        return 0;
}
int main(){
        scanf("%d %d",&Y,&X);
        int cnt = 0;
        for(int y = Y; isPrime(y) != 0; y++) cnt++;
        if(cnt==0){puts("First");return 0;}
        for(int x = X; isPrime(x) != 0; x++) cnt++;
        if(cnt==0){puts("First");return 0;}
        printf((cnt%2)?"First\n":"Second\n");
}
0