結果
| 問題 |
No.946 箱箱箱
|
| コンテスト | |
| ユーザー |
Rubikun
|
| 提出日時 | 2019-12-09 00:17:06 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 736 bytes |
| コンパイル時間 | 1,895 ms |
| コンパイル使用メモリ | 164,792 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2025-01-02 21:33:35 |
| 合計ジャッジ時間 | 3,745 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 WA * 23 |
ソースコード
#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];
}
dp[0]=0;
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;
}
}
if(dp[N]) cout<<"Takahashi"<<endl;
else cout<<"Takanashi"<<endl;
}
Rubikun