結果

問題 No.946 箱箱箱
ユーザー kotatsugame
提出日時 2019-12-01 02:28:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 571 ms
コンパイル使用メモリ 65,612 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-27 02:56:04
合計ジャッジ時間 2,064 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 51
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int N,A[2000],G[2001];
main()
{
	cin>>N;
	for(int i=0;i<N;i++)cin>>A[i];
	for(int i=N;i--;)
	{
		bool ex[2001]={};
		int now=0;
		for(int j=i;j<N;j++)
		{
			now^=A[j];
			int tmp=now^G[j+1];
			if(tmp<=N)ex[tmp]=true;
		}
		while(ex[G[i]])G[i]++;
	}
	cout<<"Taka"<<(G[0]?"h":"n")<<"ashi"<<endl;
}
0