結果
問題 | No.1454 ツブ消ししとるなEasy |
ユーザー | aaaaaaaaaa2230 |
提出日時 | 2021-03-31 22:13:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 59 ms / 2,000 ms |
コード長 | 407 bytes |
コンパイル時間 | 189 ms |
コンパイル使用メモリ | 82,500 KB |
実行使用メモリ | 83,800 KB |
最終ジャッジ日時 | 2024-12-15 19:23:04 |
合計ジャッジ時間 | 1,597 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 16 |
ソースコード
n,m,x,y = map(int,input().split()) A = sorted(list(map(int,input().split()))) ans = 0 size = 0 for i in range(n)[::-1]: if A[i] >= x: ans += A[i] size += 1 A.pop() if size > m: print("Handicapped") exit() A = A[::-1] for i in range(len(A))[::-1]: if A[i] <= y: A.pop() A = A[::-1] while A and size < m: size += 1 ans += A[-1] A.pop() print(ans)