結果
| 問題 | No.78 クジ付きアイスバー |
| コンテスト | |
| ユーザー |
Tawara
|
| 提出日時 | 2015-10-21 01:12:40 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 311 bytes |
| 記録 | |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 77,576 KB |
| 最終ジャッジ日時 | 2025-12-03 17:40:13 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 34 WA * 1 |
ソースコード
N,K = map(int,raw_input().split()) S = raw_input() need = [0]*(N+1) luck = 0 for i in xrange(N): need[i+1] = need[i] if luck == 0: need[i+1] += 1 else: luck -= 1 luck += int(S[i]) if luck >= need[N]: print need[N] else: m = K/N print need[K] if m < 1 else need[N]*m-luck*(m-1) + max(0,need[K%N]-luck)
Tawara