結果
| 問題 | 
                            No.2521 Don't be Same
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Rubikun
                         | 
                    
| 提出日時 | 2023-10-27 21:58:59 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,852 bytes | 
| コンパイル時間 | 1,985 ms | 
| コンパイル使用メモリ | 195,228 KB | 
| 最終ジャッジ日時 | 2025-02-17 15:00:19 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | TLE * 1 -- * 26 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=1<<30;
bool solve(int a,int b){
    if(a==0&&b==0) return false;
    if(a==0||b==0) return true;
    if(a==b) return true;
    
    if(a){
        for(int k=1;k<=a;k++){
            if(!solve(a-k,b)) return true;
        }
    }
    if(b){
        for(int k=1;k<=b;k++){
            if(!solve(a,b-k)) return true;
        }
    }
    return false;
}
int main(){
    
    for(int a=0;a<=10;a++){
        for(int b=0;b<=10;b++){
            //cout<<solve(a,b)<<" ";
        }
        //cout<<endl;
    }
    
    int X,Y;cin>>X>>Y;
    
    auto mov=[&](){
        if(X==Y) cout<<"B"<<endl;
        else if(X==0) cout<<"A"<<" "<<2<<" "<<Y<<endl;
        else if(Y==0) cout<<"A"<<" "<<1<<" "<<X<<endl;
        else{
            if(Y%2==0&&X>Y-1) cout<<"A"<<" "<<1<<" "<<X-(Y-1)<<endl;
            else if(Y%2==1&&X>Y+1) cout<<"A"<<" "<<1<<" "<<X-(Y+1)<<endl;
            else if(X%2==0&&Y>X-1) cout<<"A"<<" "<<2<<" "<<Y-(X-1)<<endl;
            else cout<<"A"<<" "<<2<<" "<<Y-(X+1)<<endl;
        }
    };
    
    auto wait=[&](){
        char c;cin>>c;
        if(c=='C') exit(0);
        if(c=='A'){
            ll a,b;cin>>a>>b;
            if(a==1) X-=b;
            else Y-=b;
        }else{
            X=0;
            Y=0;
        }
    };
    if((X+1==Y&&Y%2==0)||(Y+1==X&&X%2==0)){
        cout<<"Second\n";
        wait();
    }else{
        cout<<"First\n";
    }
    
    while(1){
        mov();
        wait();
    }
}
            
            
            
        
            
Rubikun