結果

問題 No.726 Tree Game
ユーザー gazelle
提出日時 2018-08-24 21:30:58
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 898 bytes
コンパイル時間 1,584 ms
コンパイル使用メモリ 193,780 KB
最終ジャッジ日時 2025-01-06 12:31:01
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#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+1,_y=y+1;
	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++;
	}
	if((abs(x-_x)+abs(y-_y)-2)%2) cout<<"First"<<endl;
	else cout<<"Second"<<endl;
}
0