結果
問題 |
No.904 サメトロ
|
ユーザー |
|
提出日時 | 2020-02-25 22:31:25 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 192 bytes |
コンパイル時間 | 72 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-13 14:36:45 |
合計ジャッジ時間 | 1,932 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 WA * 14 |
ソースコード
N = int(input()) AB = [list(map(int, input().split())) for i in range(N-1)] sa = sum(a for a, _ in AB) sb = sum(b for _, b in AB) d = sa - sb ans = min(sb, sa -d) - max(0, -d) + 1 print(ans)