結果

問題 No.740 幻の木
ユーザー むらためむらため
提出日時 2018-12-18 01:10:30
言語 Nim
(2.0.2)
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 665 bytes
コンパイル時間 861 ms
コンパイル使用メモリ 73,020 KB
最終ジャッジ日時 2024-04-27 02:45:17
合計ジャッジ時間 1,198 ms
ジャッジサーバーID
(参考情報)
judge5 / 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)
template `max=`*(x,y) = x = max(x,y)
template `min=`*(x,y) = x = min(x,y)

var (n,m,p,q) = get().split().map(parseInt).unpack(4)
var month = 0
var res = 0
while n > 0:
  if month + 1 >= p and month + 1 < p + q : n -= 2 * m
  else: n -= m
  month = (month + 1) mod 12
  res += 1
echo res
0