結果
問題 | No.68 よくある棒を切る問題 (2) |
ユーザー | pluto77 |
提出日時 | 2018-11-12 11:31:37 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 2,163 ms / 5,000 ms |
コード長 | 360 bytes |
コンパイル時間 | 506 ms |
コンパイル使用メモリ | 6,664 KB |
実行使用メモリ | 55,320 KB |
最終ジャッジ日時 | 2023-08-23 12:41:38 |
合計ジャッジ時間 | 30,813 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2,047 ms
54,756 KB |
testcase_01 | AC | 2,082 ms
54,568 KB |
testcase_02 | AC | 2,149 ms
54,676 KB |
testcase_03 | AC | 2,163 ms
55,056 KB |
testcase_04 | AC | 2,100 ms
55,320 KB |
testcase_05 | AC | 2,107 ms
55,256 KB |
testcase_06 | AC | 1,921 ms
51,960 KB |
testcase_07 | AC | 1,998 ms
53,248 KB |
testcase_08 | AC | 1,885 ms
51,412 KB |
testcase_09 | AC | 1,984 ms
52,788 KB |
ソースコード
#yuki68 from heapq import heappush, heappop N=int(raw_input()) L=map(int,raw_input().split()) Q=int(raw_input()) K=map(int,raw_input().split()) res=[0.0 for i in xrange(max(K)+1)] hp=[] for l in L: heappush(hp,(-l,l,1)) for i in range(1,max(K)+1): (a,b,n)=heappop(hp) res[i]=-a heappush(hp,(-1.0*b/(n+1),b,n+1)) for k in K: print res[k]