結果
| 問題 | 
                            No.726 Tree Game
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-08-30 11:49:43 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 688 bytes | 
| コンパイル時間 | 165 ms | 
| コンパイル使用メモリ | 22,656 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-09-13 19:48:46 | 
| 合計ジャッジ時間 | 921 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 25 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |         scanf("%d %d",&Y,&X);
      |         ~~~~~^~~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
#include <assert.h>
int Y,X;
char isPrime(int a){
        if(a == 2) return 1;
        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;
        if(isPrime(X)==1){
                cnt += 0;
        }else{
                for(int y = Y+1; isPrime(y) != 0; y++) cnt++;
        }
                printf("%d\n",cnt);
        assert(isPrime(2)==1);
        if(isPrime(Y)==1){
                cnt += 0;
        }else{
                for(int x = X+1; isPrime(x) != 0; x++) cnt++;
        }
                printf("%d\n",cnt);
        printf((cnt%2)?"First\n":"Second\n");
}