結果
| 問題 | No.1583 Building Blocks | 
| コンテスト | |
| ユーザー | 👑  Kazun | 
| 提出日時 | 2021-07-02 22:44:16 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 193 bytes | 
| コンパイル時間 | 334 ms | 
| コンパイル使用メモリ | 82,312 KB | 
| 実行使用メモリ | 64,864 KB | 
| 最終ジャッジ日時 | 2024-06-29 12:36:26 | 
| 合計ジャッジ時間 | 3,324 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 20 WA * 23 | 
ソースコード
N=int(input())
F=[]
for _ in range(N):
    w,s=map(int,input().split())
    F.append((w,s))
F.sort(key=lambda x:sum(x))
W=0
K=0
for w,s in F:
    if W<=s:
        W+=w
        K+=1
print(K)
            
            
            
        