結果
| 問題 |
No.946 箱箱箱
|
| コンテスト | |
| ユーザー |
tko919
|
| 提出日時 | 2019-12-09 00:21:01 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 728 bytes |
| コンパイル時間 | 1,638 ms |
| コンパイル使用メモリ | 160,900 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2025-01-02 21:48:18 |
| 合計ジャッジ時間 | 3,051 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 42 WA * 9 |
コンパイルメッセージ
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 f=0; int idx=0,g=0;
while(idx<n){
g^=a[idx]; if(g==0)f^=1;
idx++;
}
printf(f?"Takahashi":"Takanashi");
return 0;
}
tko919