結果
| 問題 | No.78 クジ付きアイスバー |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-09-30 10:40:50 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 344 bytes |
| 記録 | |
| コンパイル時間 | 348 ms |
| コンパイル使用メモリ | 77,392 KB |
| 最終ジャッジ日時 | 2025-12-03 21:41:36 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 34 WA * 1 |
ソースコード
#yuki_78 n,k=map(int,raw_input().split()) s=raw_input() res=0 point=cost=0 if k>n: for i in xrange(n): if point==0: cost+=1 else: point-=1 point+=int(s[i]) res+=cost k=k-n res+=k/n*max(cost-point,0) cost2=0 point2=point for i in xrange(k%n): if point2==0: cost2+=1 else: point2-=1 point2+=int(s[i]) res+=cost2 print res