結果
問題 |
No.904 サメトロ
|
ユーザー |
![]() |
提出日時 | 2020-02-02 21:44:51 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 1,000 ms |
コード長 | 346 bytes |
コンパイル時間 | 184 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-18 21:27:09 |
合計ジャッジ時間 | 2,228 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
ソースコード
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(readline()) m = map(int,read().split()) A,B = zip(*zip(m,m)) A,B SA = sum(A) SB = sum(B) low = max(SA,SB,max(a+b for a,b in zip(A,B))) high = SA + SB answer = high - low + 1 if answer < 0: answer = 0 print(answer)