結果
| 問題 |
No.726 Tree Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-08-25 00:46:37 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 671 bytes |
| コンパイル時間 | 1,165 ms |
| コンパイル使用メモリ | 157,936 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-23 16:51:54 |
| 合計ジャッジ時間 | 1,967 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 WA * 5 |
ソースコード
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i=a; i<n; i++)
#define RREP(i, a, n) for(ll i=n-1; i>=a; i--)
typedef long long ll;
const ll mod =1e9+7;
const ll inf =1e18;
using namespace std;
ll y, x;
bool IsPrime(ll num)
{
if (num < 2) return false;
for (ll i = 2; i*i <= num; i++) {
if (num % i == 0) return false;
}
return true;
}
int main() {
cin>>y>>x;
ll ans=0;
while(!IsPrime(y)){
y++;
if(IsPrime(y)) break;
ans++;
}
while(!IsPrime(x)){
x++;
if(IsPrime(x)) break;
ans++;
}
if(ans%2==0) cout<<"Second"<<endl;
else cout<<"First"<<endl;
return 0;
}