結果
| 問題 | 
                            No.726 Tree Game
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-09-01 15:21:17 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 577 bytes | 
| コンパイル時間 | 1,287 ms | 
| コンパイル使用メモリ | 158,204 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-09-18 21:43:43 | 
| 合計ジャッジ時間 | 2,143 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 WA * 6 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define int long long
bool IsPrimeNumber(int n){
	if(n == 2 || n == 3)return true;
	if(n%2 == 0 || n%3 == 0|| n <= 4) return false;
	for(int i = 6; (i-1)*(i-1) <= n; i+=6)
		if(n%(i-1) == 0 || n%(i+1) == 0) return false;
	return true;
}
bool hoge(int Y, int X){
	int tempa = 0, tempb=0;
	while(!IsPrimeNumber(++X)&&!IsPrimeNumber(Y))
		tempa++;
	while(!IsPrimeNumber(++Y)&&!IsPrimeNumber(X))
		tempb++;
	return (tempa+tempb)%2;
}
signed main(){
	int Y, X;
	
	cin>>Y>>X;
	
	cout<<(hoge(Y,X)?"First":"Second")<<endl;
	
	return 0;
}