結果

問題 No.1205 Eye Drops
ユーザー liny_tail
提出日時 2020-11-22 19:25:04
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 403 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 18,816 KB
最終ジャッジ日時 2024-07-23 16:42:03
合計ジャッジ時間 4,703 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())

T = []
P = []
for i in range(M):
  t, p = map(int, input().split())
  T.append(t)
  P.append(p)

pos = 0
tim = 0

for t, p in zip(T, P):
  #print('tim:{} pos:{} t-tim:{} p:{}'.format(tim, pos, t-tim, p))
  if max(pos - p, p - pos) > t - tim:
    break
  else:
    tim = t
    pos = p
else:
  print('Yes')
  exit(0)

print('No')
0