結果

問題 No.1205 Eye Drops
コンテスト
ユーザー kou_kkk
提出日時 2024-03-26 12:35:46
言語 Nim
(2.2.8)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 359 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,915 ms
コンパイル使用メモリ 68,300 KB
実行使用メモリ 18,156 KB
最終ジャッジ日時 2026-04-16 17:23:38
合計ジャッジ時間 5,586 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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