結果
問題 |
No.78 クジ付きアイスバー
|
ユーザー |
![]() |
提出日時 | 2017-11-17 21:45:58 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 495 bytes |
コンパイル時間 | 89 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-11-25 08:53:19 |
合計ジャッジ時間 | 2,354 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 4 |
other | RE * 35 |
ソースコード
def buy_box(ice_box, buy=0, hit=0): for ice in ice_box: if hit>0:hit-=1 else:buy+=1 hit+=ice return buy,hit def main(): box_len,full,ice_box = map(int,input().split()) ice_box=[int(i) for i in input()] if box_len>=full:print(buy_box(ice_box[:full])[0]) else: buy,hit=buy_box(ice_box) if hit>=box_len:print(buy) else:print(buy+buy_box(ice_box,hit=hit)[0]*(full//box_len-1)+buy_box(ice_box[:full%box_len],hit=hit)[0]) main()