結果
問題 | No.726 Tree Game |
ユーザー |
|
提出日時 | 2019-10-12 18:54:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 400 bytes |
コンパイル時間 | 497 ms |
コンパイル使用メモリ | 64,924 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-28 20:41:50 |
合計ジャッジ時間 | 1,379 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 WA * 5 |
コンパイルメッセージ
main.cpp:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 11 | main() | ^~~~
ソースコード
#include<iostream>using namespace std;bool isp(int X){if(X<2)return false;if(X==2)return true;if(X%2==0)return false;for(int i=3;i*i<=X;i+=2)if(X%i==0)return false;return true;}main(){int X,Y;cin>>X>>Y;int L=1,R=1;while(!isp(X+L))L++;while(!isp(Y+R))R++;int T=L+R-2;X=isp(X),Y=isp(Y);if(X&&Y)T=0;if(X&&!Y)T=R-1;if(!X&&Y)T=L-1;cout<<(T&1?"First":"Second")<<endl;}