結果

問題 No.946 箱箱箱
ユーザー mtsdmtsd
提出日時 2019-12-09 18:40:11
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 363 ms / 2,000 ms
コード長 762 bytes
コンパイル時間 821 ms
コンパイル使用メモリ 78,036 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-09 10:12:08
合計ジャッジ時間 12,845 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 234 ms
4,380 KB
testcase_04 AC 237 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 237 ms
4,376 KB
testcase_07 AC 238 ms
4,376 KB
testcase_08 AC 241 ms
4,376 KB
testcase_09 AC 301 ms
4,376 KB
testcase_10 AC 233 ms
4,380 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 284 ms
4,376 KB
testcase_13 AC 241 ms
4,380 KB
testcase_14 AC 237 ms
4,380 KB
testcase_15 AC 234 ms
4,380 KB
testcase_16 AC 235 ms
4,376 KB
testcase_17 AC 234 ms
4,376 KB
testcase_18 AC 237 ms
4,376 KB
testcase_19 AC 335 ms
4,380 KB
testcase_20 AC 2 ms
4,504 KB
testcase_21 AC 238 ms
4,376 KB
testcase_22 AC 235 ms
4,376 KB
testcase_23 AC 237 ms
4,380 KB
testcase_24 AC 242 ms
4,380 KB
testcase_25 AC 363 ms
4,380 KB
testcase_26 AC 235 ms
4,376 KB
testcase_27 AC 235 ms
4,380 KB
testcase_28 AC 233 ms
4,376 KB
testcase_29 AC 239 ms
4,376 KB
testcase_30 AC 237 ms
4,376 KB
testcase_31 AC 238 ms
4,380 KB
testcase_32 AC 230 ms
4,376 KB
testcase_33 AC 236 ms
4,380 KB
testcase_34 AC 239 ms
4,376 KB
testcase_35 AC 237 ms
4,376 KB
testcase_36 AC 237 ms
4,376 KB
testcase_37 AC 237 ms
4,376 KB
testcase_38 AC 362 ms
4,380 KB
testcase_39 AC 231 ms
4,376 KB
testcase_40 AC 239 ms
4,380 KB
testcase_41 AC 234 ms
4,376 KB
testcase_42 AC 237 ms
4,376 KB
testcase_43 AC 237 ms
4,380 KB
testcase_44 AC 362 ms
4,376 KB
testcase_45 AC 236 ms
4,380 KB
testcase_46 AC 238 ms
4,376 KB
testcase_47 AC 1 ms
4,380 KB
testcase_48 AC 1 ms
4,376 KB
testcase_49 AC 1 ms
4,380 KB
testcase_50 AC 2 ms
4,380 KB
testcase_51 AC 1 ms
4,380 KB
testcase_52 AC 2 ms
4,380 KB
testcase_53 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<set>
using namespace std;
int main(){
    int n;
    cin >> n;
    bool flag = 0;
    vector<int> a(n);
    vector<int> s(n+1);
    vector<int> res(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
        s[i] = a[i];
    }   
    for(int i=n-2;i>=0;i--){
        s[i]^= s[i+1];
    }
    for(int i=n-1;i>=0;i--){
        set<int> st;
        for(int j=i;j<n-1;j++){
            int c = s[i]^s[j+1]^res[j+1];
            st.insert(c);
        }
        st.insert(s[i]);
        for(int j=0;j<2010;j++){
            if(st.count(j)==0){
                res[i] = j;
                break;
            }
        }
    }
    if(res[0]!=0)cout << "Takahashi" << endl;
    else cout << "Takanashi" << endl;
    return 0;
}
0