結果
| 問題 |
No.946 箱箱箱
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-21 01:47:05 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 14 ms / 2,000 ms |
| コード長 | 857 bytes |
| コンパイル時間 | 6,003 ms |
| コンパイル使用メモリ | 332,912 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-02-21 01:47:14 |
| 合計ジャッジ時間 | 8,507 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 51 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using mint = atcoder::static_modint<998244353>;
//using mint = atcoder::static_modint<1000000007>;
using namespace std;
using namespace atcoder;
using ld = long double;
using ll = long long;
#define mp(a,b) make_pair(a,b)
#define rep(i,s,n) for(int i=s; i<(int)n; i++)
const vector<int> dx{1,0,-1,0},dy{0,1,0,-1};
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;cin >> n;
vector<int> a(n+1);rep(i,1,n+1)cin >> a[i];
vector<int> s=a;
rep(i,1,n+1)s[i]^=s[i-1];
vector<int> G(n+2);
for(int i=n-1; i>=1; i--){
vector<bool> b(3000);
rep(j,i,n+1){
int g=s[j]^s[i-1];
g^=G[j+1];
if(g<3000)b[g]=true;
}
while(b[G[i]])G[i]++;
}
if(G[1])cout << "Takahashi\n";
else cout << "Takanashi\n";
}