結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー むらためむらため
提出日時 2019-01-17 17:49:04
言語 Nim
(2.0.2)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,012 bytes
コンパイル時間 863 ms
コンパイル使用メモリ 73,144 KB
最終ジャッジ日時 2024-04-27 02:46:20
合計ジャッジ時間 1,354 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
/home/judge/data/code/Main.nim(2, 28) Error: cannot open file: queues

ソースコード

diff #

import sequtils,strutils,algorithm,math,sugar,macros,strformat
import sets,tables,intsets,queues,heapqueue,bitops
template get*():string = stdin.readLine().strip()
macro unpack*(arr: auto,cnt: static[int]): auto =
  let t = genSym(); result = quote do:(let `t` = `arr`;())
  for i in 0..<cnt: result[1].add(quote do:`t`[`i`])
template times*(n:int,body) = (for _ in 0..<n: body)
proc toCountSeq[T](x:seq[T]) : seq[tuple[k:T,v:int]] = toSeq(x.toCountTable().pairs)
template `max=`*(x,y) = x = max(x,y)
template `min=`*(x,y) = x = min(x,y)

let (n,xLB,xRB) = get().split().map(parseInt).unpack(3)
let LURD = newSeqWith(n,get().split().map(parseInt).unpack(4))
let enLURD = toSeq(0..<n).mapIt((it,LURD[it])).sortedByIt(-it[1][3])
var limits = newSeqWith(1281,-1e8.int)
var hits = newSeq[bool](n)
for ilurd in enLURD:
  let (i,lurd) = ilurd
  let (l,u,r,d) = lurd
  for x in xLB.max(l)..xRB.min(r):
    if limits[x] >= d: continue
    limits[x] = d
    hits[i] = true
for hit in hits:
  if hit : echo 1
  else:echo 0
0