結果

問題 No.274 The Wall
ユーザー むらため
提出日時 2019-02-03 23:20:02
言語 Nim
(2.2.0)
結果
WA  
実行時間 -
コード長 598 bytes
コンパイル時間 2,331 ms
コンパイル使用メモリ 61,612 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-01 11:18:19
合計ジャッジ時間 3,400 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 2 WA * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
/home/judge/data/code/Main.nim(1, 8) Warning: imported and not used: 'sequtils' [UnusedImport]

ソースコード

diff #

import sequtils
#import algorithm
template times*(n:int,body) = (for _ in 0..<n: body)

proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}
proc scan(): int =
  while true:
    let k = getchar_unlocked()
    if k < '0': return
    result = 10 * result + k.ord - '0'.ord

let n = scan()
let m = scan()
var U = newSeq[bool](m)
proc fill(l,r:int) : bool =
  for i in l..r:
    if U[i] : return false
  for i in l..r: U[i] = true
  return true
n.times:
  let l = scan()
  let r = scan()
  if fill(l,r) : continue
  if fill(m-r-1,m-l-1) : continue
  quit "NO",0
echo "YES"
0