結果

問題 No.1246 ANDORゲーム(max)
ユーザー tailstails
提出日時 2020-10-03 20:01:21
言語 cLay
(20231016-1)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 354 bytes
コンパイル時間 3,505 ms
コンパイル使用メモリ 160,472 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-19 01:27:58
合計ジャッジ時間 7,409 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 3 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 3 ms
4,380 KB
testcase_15 AC 4 ms
4,380 KB
testcase_16 AC 58 ms
4,376 KB
testcase_17 AC 59 ms
4,380 KB
testcase_18 AC 58 ms
4,376 KB
testcase_19 AC 59 ms
4,376 KB
testcase_20 AC 59 ms
4,380 KB
testcase_21 AC 59 ms
4,380 KB
testcase_22 AC 59 ms
4,384 KB
testcase_23 AC 10 ms
4,384 KB
testcase_24 AC 41 ms
4,384 KB
testcase_25 AC 41 ms
4,380 KB
testcase_26 AC 41 ms
4,376 KB
testcase_27 AC 10 ms
4,380 KB
testcase_28 AC 46 ms
4,384 KB
testcase_29 AC 46 ms
4,384 KB
testcase_30 AC 45 ms
4,380 KB
testcase_31 AC 12 ms
4,380 KB
testcase_32 AC 12 ms
4,380 KB
testcase_33 AC 12 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

int n,t,k,a,b[32],c[32];
ll d[32],e[32];
{
	b[0..30]=-1;
	rd(n,*b);
	rep(n){
		rep(j,31){
			c[j]=b[j]; b[j]=-1;
			e[j]=d[j]; d[j]=0;
		}
		rd(a);
		rep(j,31){
			if(c[j]>=0){
				t=c[j]&a;
				k=BIT_popcount(t);
				b[k]=t;
				d[k]>?=e[j]+c[j]-t;
				t=c[j]|a;
				k=BIT_popcount(t);
				b[k]=t;
				d[k]>?=e[j]-c[j]+t;
			}
		}
	}
	wt(max(d(31)));
}
0