結果

問題 No.946 箱箱箱
ユーザー chocorusk
提出日時 2019-12-09 02:15:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,038 bytes
コンパイル時間 1,714 ms
コンパイル使用メモリ 106,016 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-03 06:02:49
合計ジャッジ時間 2,877 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 47 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;

int main()
{
    int n; cin>>n;
    int a[2020];
    for(int i=0; i<n; i++){
        cin>>a[i];
    }
    int s=0;
    for(int i=0; i<n; i++){
        s^=a[i];
        if(s==0){
            cout<<"Takahashi"<<endl;
            return 0;
        }
    }
    if(a[0]==1){
        s=0;
        for(int i=1; i<n; i++){
            s^=a[i];
            if(s==0){
                cout<<"Takahashi"<<endl;
                return 0;
            }
        }
    }
    cout<<"Takanashi"<<endl;
    return 0;
}
0