結果

問題 No.1205 Eye Drops
コンテスト
ユーザー kou_kkk
提出日時 2024-03-26 12:35:46
言語 Nim
(2.2.10 + ACL)
コンパイル:
nim --nimcache=~ --hints:off -o:a.out -d:release cpp _filename_
実行:
./a.out
結果
AC  
実行時間 45 ms / 2,000 ms
+ 177µs
コード長 359 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,595 ms
コンパイル使用メモリ 70,428 KB
実行使用メモリ 18,048 KB
最終ジャッジ日時 2026-09-06 19:11:20
合計ジャッジ時間 5,600 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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