結果

問題 No.78 クジ付きアイスバー
ユーザー matriematrie
提出日時 2021-01-25 09:39:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 249 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 7,996 KB
最終ジャッジ日時 2023-09-03 20:06:30
合計ジャッジ時間 2,363 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,852 KB
testcase_01 AC 16 ms
7,832 KB
testcase_02 AC 16 ms
7,804 KB
testcase_03 AC 16 ms
7,792 KB
testcase_04 AC 16 ms
7,892 KB
testcase_05 WA -
testcase_06 AC 16 ms
7,792 KB
testcase_07 WA -
testcase_08 AC 16 ms
7,836 KB
testcase_09 AC 16 ms
7,808 KB
testcase_10 AC 15 ms
7,832 KB
testcase_11 AC 16 ms
7,832 KB
testcase_12 WA -
testcase_13 AC 16 ms
7,824 KB
testcase_14 AC 16 ms
7,896 KB
testcase_15 AC 16 ms
7,984 KB
testcase_16 WA -
testcase_17 AC 15 ms
7,852 KB
testcase_18 AC 16 ms
7,796 KB
testcase_19 WA -
testcase_20 AC 16 ms
7,828 KB
testcase_21 AC 16 ms
7,744 KB
testcase_22 WA -
testcase_23 AC 15 ms
7,796 KB
testcase_24 AC 16 ms
7,940 KB
testcase_25 AC 15 ms
7,952 KB
testcase_26 WA -
testcase_27 AC 16 ms
7,876 KB
testcase_28 AC 15 ms
7,828 KB
testcase_29 AC 16 ms
7,792 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 16 ms
7,824 KB
testcase_33 AC 16 ms
7,828 KB
testcase_34 WA -
testcase_35 AC 15 ms
7,876 KB
testcase_36 AC 16 ms
7,908 KB
testcase_37 AC 16 ms
7,892 KB
testcase_38 AC 16 ms
7,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
L=[int(i) for i in list(input())]

def t(x):
	a=b=0
	for i in range(x):
		if a>0:a-=1
		else:b+=1
		a+=L[i%n]
	return(b,b-a)

if k<n:y=t(k)[0]
else:
	if sum(L)>len(L):y=t(n)[0]
	else:y=t(n)[1]*(k//n)+t(k%n)[0]
	
print(y)
0