結果

問題 No.1205 Eye Drops
ユーザー kou_kkk
提出日時 2024-03-26 12:35:46
言語 Nim
(2.2.0)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 3,389 ms
コンパイル使用メモリ 66,048 KB
実行使用メモリ 13,440 KB
最終ジャッジ日時 2024-09-30 14:14:39
合計ジャッジ時間 5,519 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

import algorithm, sequtils, strutils

let
  m = stdin.readLine.split.map(parseInt).`[]`1
  tps = m.newSeqWith stdin.readLine.split.map parseInt
  stps = tps.sortedByIt it[0]
var
  pos = 0
  cnt = 0

for tp in stps:
  let
    t = tp[0]
    p = tp[1]
    a = t - cnt
    d = abs pos - p
  
  if a < d:
    echo "No"
    quit()
  
  pos = p
  cnt = t

echo "Yes"
0