結果
| 問題 | No.3808 Welcome to Mid Difficulty Problems |
| コンテスト | |
| ユーザー |
回転
|
| 提出日時 | 2026-11-22 12:14:48 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 472 ms / 2,000 ms |
| + 690µs | |
| コード長 | 633 bytes |
| 記録 | |
| コンパイル時間 | 93 ms |
| コンパイル使用メモリ | 64,128 KB |
| 実行使用メモリ | 165,208 KB |
| 最終ジャッジ日時 | 2026-11-22 12:14:56 |
| 合計ジャッジ時間 | 7,681 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
from collections import defaultdict
from itertools import accumulate
import bisect
N,T = list(map(int,input().split()))
pro = defaultdict(list)
for _ in range(N):
a,b = list(map(int,input().split()))
pro[a].append(b)
two = []
for i in pro:
MIN = min(pro[i])
pro[i].remove(MIN)
two.append(MIN)
two.sort()
one = sorted([j for i in pro for j in pro[i]])
SS = [0] + list(accumulate(two))
S = [0] + list(accumulate(one))
ans = 0
for i in range(len(two)+1):
now = SS[i]
if(now > T):break
place = bisect.bisect_right(S, T - now) - 1
assert now + S[place] <= T
ans = max(ans, 2*i + place)
print(ans)
回転