結果
| 問題 |
No.726 Tree Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-30 11:37:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 360 bytes |
| コンパイル時間 | 128 ms |
| コンパイル使用メモリ | 22,272 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-13 19:48:41 |
| 合計ジャッジ時間 | 956 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 WA * 6 |
コンパイルメッセージ
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; isPrime(y) != 0; y++) cnt++;
for(int x = X; isPrime(x) != 0; x++) cnt++;
printf((cnt%2)?"First\n":"Second\n");
}