結果
| 問題 | 
                            No.1715 Dinner 2
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-10-22 22:31:27 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 272 bytes | 
| コンパイル時間 | 188 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 11,008 KB | 
| 最終ジャッジ日時 | 2024-09-23 06:11:25 | 
| 合計ジャッジ時間 | 2,525 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 4 WA * 34 | 
ソースコード
N,D = map(int,input().split())
pq = [list(map(int,input().split()))for _ in range(N)]
pq.sort(key=lambda x:x[1]-x[0],reverse=True)
l = [0]+sorted(list(map(lambda x:x[1]-x[0],pq)),reverse=True)
ans = 0
for i,x in enumerate(l[:-1]):
    ans = min(ans,x-pq[i][0])
print(ans)