結果
問題 | No.78 クジ付きアイスバー |
ユーザー |
![]() |
提出日時 | 2024-01-16 12:22:27 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 451 bytes |
コンパイル時間 | 173 ms |
コンパイル使用メモリ | 82,036 KB |
実行使用メモリ | 52,352 KB |
最終ジャッジ日時 | 2024-09-28 02:28:22 |
合計ジャッジ時間 | 2,866 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 24 WA * 11 |
ソースコード
N, K = map(int, input().split())S = [int(s) for s in input()]ans, x, y = 0, 0, 0for i in range(N):if y:y -= 1else:x += 1y += S[i]if i == K - 1:print(x)exit()if y >= x:print(x)exit()K -= Nans = x + (x - y) * (K - 1)//NK -= (K - 1)//N*Nfor i in range(N):if y:y -= 1else:ans += 1y += S[i]if i == K - 1:print(ans)exit()