結果

問題 No.904 サメトロ
ユーザー simamumusimamumu
提出日時 2019-10-11 21:35:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 533 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 87,336 KB
実行使用メモリ 81,104 KB
最終ジャッジ日時 2023-08-16 17:20:13
合計ジャッジ時間 7,536 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
80,948 KB
testcase_01 WA -
testcase_02 AC 156 ms
80,944 KB
testcase_03 WA -
testcase_04 AC 150 ms
80,768 KB
testcase_05 AC 155 ms
80,940 KB
testcase_06 AC 153 ms
80,928 KB
testcase_07 WA -
testcase_08 AC 152 ms
80,852 KB
testcase_09 AC 161 ms
80,876 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 150 ms
80,688 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 153 ms
80,724 KB
testcase_16 WA -
testcase_17 AC 152 ms
80,796 KB
testcase_18 AC 153 ms
80,832 KB
testcase_19 WA -
testcase_20 AC 155 ms
80,876 KB
testcase_21 WA -
testcase_22 AC 154 ms
80,964 KB
testcase_23 WA -
testcase_24 AC 159 ms
80,796 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 150 ms
80,800 KB
testcase_28 AC 158 ms
80,968 KB
testcase_29 AC 152 ms
80,964 KB
testcase_30 AC 154 ms
80,880 KB
testcase_31 AC 152 ms
80,884 KB
testcase_32 AC 151 ms
80,684 KB
testcase_33 AC 151 ms
80,988 KB
testcase_34 AC 153 ms
80,692 KB
testcase_35 AC 151 ms
80,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N = inp()
sA = sB = mA = mB = 0
for _ in range(N-1):
    A,B = inpl()
    sA += A
    sB += B
    mA = max(A,mA)
    mB = max(B,mB)

if N == 2:
    print(1)
else:
    print(min(sA,sB)+1)
0