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