結果
| 問題 |
No.946 箱箱箱
|
| コンテスト | |
| ユーザー |
Rubikun
|
| 提出日時 | 2019-12-09 00:37:10 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,137 bytes |
| コンパイル時間 | 1,497 ms |
| コンパイル使用メモリ | 164,148 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2025-01-02 22:43:53 |
| 合計ジャッジ時間 | 2,894 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 44 WA * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=998244353,MAX=2005;
const ll INF=1LL<<60;
bool dp[MAX];//0なら負け
int main(){
std::ifstream in("text.txt");
std::cin.rdbuf(in.rdbuf());
cin.tie(0);
ios::sync_with_stdio(false);
int N;cin>>N;
vector<ll> A(N),xo(N+1);
for(int i=0;i<N;i++){
cin>>A[i];
xo[i+1]=xo[i]^A[i];
}
bool ok=false;
for(int i=1;i<=N;i++){
if(xo[i]==0){
ok=true;
for(int j=i+1;j<N;j++){
if((xo[j]^xo[N])==0) ok=false;
}
if(ok) break;
}
}
if(ok) cout<<"Takahashi"<<endl;
else cout<<"Takanashi"<<endl;
/*for(int i=1;i<=N;i++){
for(int j=0;j<i;j++){
if(dp[j]==0&&(xo[j]^xo[i])==0) dp[i]=1;
if(dp[j]==1&&(xo[j]^xo[i])!=0) dp[i]=1;
}
for(int j=0;j<i;j++){
if(dp[j]==1&&(xo[j]^xo[i])==0) dp[i]=0;
}
}
if(dp[N]) cout<<"Takahashi"<<endl;
else cout<<"Takanashi"<<endl;*/
}
Rubikun