結果
問題 | No.946 箱箱箱 |
ユーザー |
![]() |
提出日時 | 2019-12-09 00:50:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 931 bytes |
コンパイル時間 | 1,501 ms |
コンパイル使用メモリ | 163,936 KB |
実行使用メモリ | 17,104 KB |
最終ジャッジ日時 | 2025-01-02 23:27:58 |
合計ジャッジ時間 | 126,943 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 3 TLE * 41 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:17:17: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | int n; scanf("%d",&n); | ~~~~~^~~~~~~~~ main.cpp:19:20: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | rep(i,0,n)scanf("%d",&a[i]); | ~~~~~^~~~~~~~~~~~
ソースコード
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; //template #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(a);i>(b);i--) #define ALL(v) (v).begin(),(v).end() typedef long long int ll; const int inf = 0x3fffffff; const ll INF = 0x3fffffffffffffff; template<class T> inline bool chmax(T& a,T b){ if(a<b){a=b;return 1;}return 0; } template<class T> inline bool chmin(T& a,T b){ if(a>b){a=b;return 1;}return 0; } //template end int main(){ int n; scanf("%d",&n); vector<int> a(n); rep(i,0,n)scanf("%d",&a[i]); bool ans[2010]; rep(i,0,n+1)ans[i]=1; reverse(ALL(a)); rep(i,0,n){ int g=0; rep(j,0,i+1)g^=a[j]; rrep(j,i,-1){ cerr<<g<<i<<endl; if(g==0&&ans[j]){ans[i+1]=0; break;} g^=a[j]; } } rep(i,0,n+1)cerr<<ans[i]<<endl; printf(ans[n]?"Takanashi":"Takahashi"); return 0; }