結果
| 問題 |
No.904 サメトロ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-10 20:53:15 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 479 bytes |
| コンパイル時間 | 253 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-09-15 13:20:19 |
| 合計ジャッジ時間 | 2,482 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 WA * 14 |
ソースコード
MOD = 10 ** 9 + 7
INF = 10 ** 10
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from collections import deque
from heapq import heapify,heappush,heappop
def main():
n = int(input())
tota = 0
totb = 0
for _ in range(n - 1):
a,b = map(int,input().split())
tota += a
totb += b
if totb - tota > 0:
ans = tota + 1
else:
ans = totb + 1
print(ans)
if __name__ =='__main__':
main()