結果
| 問題 | 
                            No.726 Tree Game
                             | 
                    
| コンテスト | |
| ユーザー | 
                             gazelle
                         | 
                    
| 提出日時 | 2018-08-24 21:34:05 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 906 bytes | 
| コンパイル時間 | 1,635 ms | 
| コンパイル使用メモリ | 193,128 KB | 
| 最終ジャッジ日時 | 2025-01-06 12:31:36 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 19 WA * 6 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using P=pair<ll,ll>;
#define MOD 1000000007ll
#define INF 1000000000ll
#define EPS 1e-10
#define FOR(i,n,m) for(ll i=n;i<(ll)m;i++)
#define REP(i,n) FOR(i,0,n)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v) sort(ALL(v));v.erase(unique(ALL(v)),v.end());
#define pb push_back
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll y,x;
	cin>>y>>x;
	ll _x=x,_y=y;
	while(1) {
		bool d=false;
		for(ll i=2; i*i<=_x;i++) {
			if(_x%i==0) {
				d=true;
				break;
			}
		}
		if(!d) break;
		_x++;
	}
	while(1) {
		bool d=false;
		for(ll i=2; i*i<=_y;i++) {
			if(_y%i==0) {
				d=true;
				break;
			}
		}
		if(!d) break;
		_y++;
	}
	_y--;
	_x--;
	if((abs(x-_x)+abs(y-_y))%2) cout<<"First"<<endl;
	else cout<<"Second"<<endl;
}
            
            
            
        
            
gazelle