結果
| 問題 |
No.904 サメトロ
|
| コンテスト | |
| ユーザー |
takakin
|
| 提出日時 | 2020-07-10 00:24:36 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 388 bytes |
| コンパイル時間 | 362 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 15,744 KB |
| 最終ジャッジ日時 | 2024-10-08 19:34:28 |
| 合計ジャッジ時間 | 9,665 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 26 TLE * 2 -- * 5 |
ソースコード
import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
AB=[]
at,bt=0,0
for _ in range(n-1):
a,b=map(int,input().split())
AB.append((a,b))
at+=a
bt+=b
ans=0
for a in range(n*10000+1):
b=a+at-bt
if b<0 or a>bt:
continue
else:
chk=True
for i in range(1,n):
if AB[i-1][0]>bt+b-AB[i-1][1]:
chk=False
if chk:
ans+=1
print(ans)
takakin