結果
| 問題 | 
                            No.2285 Make A Unit Square
                             | 
                    
| コンテスト | |
| ユーザー | 
                             shobonvip
                         | 
                    
| 提出日時 | 2023-04-28 22:13:53 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 196 ms / 2,000 ms | 
| コード長 | 686 bytes | 
| コンパイル時間 | 3,639 ms | 
| コンパイル使用メモリ | 253,924 KB | 
| 最終ジャッジ日時 | 2025-02-12 15:16:16 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 4 | 
ソースコード
#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
typedef modint998244353 mint;
typedef long long ll;
void solve(vector<int> &dp){
	int a, b; cin >> a >> b;
	
	int x = 0;
	if (a <= 100) x ^= dp[a];
	else x ^= dp[a % 34 + 68];
	if (b <= 100) x ^= dp[b];
	else x ^= dp[b % 34 + 68];
	if (x > 0) cout << "First\n";
	else cout << "Second\n";
}
int main(){
	int mx = 150;
	vector<int> dp(mx+1);
	for (int i=4; i<mx+1; i++){
		set<int> r;
		for (int j=2; j<=i-2; j++){
			r.insert(dp[j] ^ dp[i-j]);
		}
		int piv = 0;
		while(r.find(piv) != r.end()) piv++;
		dp[i] = piv;
		//cout << dp[i] << endl;
	}
	int t; cin >> t;
	while(t--) solve(dp);
}
            
            
            
        
            
shobonvip