結果

問題 No.1267 Stop and Coin Game
ユーザー tailstails
提出日時 2020-10-23 22:46:43
言語 cLay
(20240104-1)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 436 bytes
コンパイル時間 2,222 ms
コンパイル使用メモリ 159,912 KB
実行使用メモリ 21,892 KB
最終ジャッジ日時 2023-09-19 01:41:02
合計ジャッジ時間 5,441 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,468 KB
testcase_01 AC 2 ms
7,376 KB
testcase_02 AC 2 ms
7,408 KB
testcase_03 AC 3 ms
7,376 KB
testcase_04 AC 2 ms
7,492 KB
testcase_05 AC 3 ms
7,424 KB
testcase_06 AC 2 ms
7,376 KB
testcase_07 AC 2 ms
7,368 KB
testcase_08 AC 4 ms
8,408 KB
testcase_09 AC 2 ms
7,368 KB
testcase_10 AC 31 ms
21,724 KB
testcase_11 AC 16 ms
13,680 KB
testcase_12 AC 5 ms
7,632 KB
testcase_13 AC 3 ms
7,388 KB
testcase_14 AC 3 ms
7,384 KB
testcase_15 AC 2 ms
7,564 KB
testcase_16 AC 57 ms
21,892 KB
testcase_17 AC 3 ms
7,356 KB
testcase_18 AC 3 ms
7,492 KB
testcase_19 AC 3 ms
7,468 KB
testcase_20 AC 2 ms
7,364 KB
testcase_21 AC 2 ms
7,572 KB
testcase_22 AC 2 ms
7,540 KB
testcase_23 AC 2 ms
7,364 KB
testcase_24 AC 9 ms
17,692 KB
testcase_25 AC 49 ms
17,788 KB
testcase_26 AC 2 ms
7,396 KB
testcase_27 AC 3 ms
7,768 KB
testcase_28 AC 3 ms
7,488 KB
testcase_29 AC 2 ms
7,412 KB
testcase_30 AC 10 ms
21,712 KB
testcase_31 AC 3 ms
7,452 KB
testcase_32 AC 3 ms
8,396 KB
testcase_33 AC 7 ms
17,792 KB
testcase_34 AC 36 ms
17,592 KB
testcase_35 AC 9 ms
21,700 KB
testcase_36 AC 2 ms
7,528 KB
testcase_37 AC 12 ms
8,388 KB
testcase_38 AC 66 ms
21,680 KB
testcase_39 AC 7 ms
7,936 KB
testcase_40 AC 2 ms
7,616 KB
testcase_41 AC 8 ms
8,092 KB
testcase_42 AC 3 ms
7,432 KB
testcase_43 AC 14 ms
8,424 KB
testcase_44 AC 6 ms
15,568 KB
testcase_45 AC 2 ms
7,424 KB
testcase_46 AC 2 ms
7,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll g[1<<20],a[20],b[1<<20];
{
	ll @n,@v;
	rd(a(n));

	int k=0;
	for(int i=1;i<1<<n;++i){
		if(i&i-1){
			b[i]=b[i&i-1]+b[i&-i];
		}else{
			b[i]=a[k++];
		}
	}
	if(b[(1<<n)-1]<=v){
		wt("Draw");
		exit(0);
	}
	for(int i=1<<n;--i>=0;){
		if(b[i]>v){
			g[i]=24;
		}else{
			int t=0;
			for(int j=1;j<1<<n;j<<=1){
				if(~i&j){
					t|=1<<g[i|j];
				}
			}
			while(t&1){
				t>>=1;
				g[i]++;
			}
		}
	}
	wt(g[0]?"First":"Second");
}
0