結果
問題 | No.232 めぐるはめぐる (2) |
ユーザー |
|
提出日時 | 2019-01-25 16:13:36 |
言語 | Nim (2.2.0) |
結果 |
CE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,359 bytes |
コンパイル時間 | 537 ms |
コンパイル使用メモリ | 52,720 KB |
最終ジャッジ日時 | 2024-11-14 20:47:52 |
合計ジャッジ時間 | 1,340 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
/home/judge/data/code/Main.nim(2, 21) Error: cannot open file: queues
ソースコード
import sequtils,algorithm,math,tablesimport sets,intsets,queues,heapqueue,bitops,strutilstemplate 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)proc printf(formatstr: cstring){.header: "<stdio.h>", varargs.}proc put(c:char){. importc:"putchar_unlocked",header: "<stdio.h>" .}proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "<stdio.h>" .}proc scan(): int =while true:let k = getchar_unlocked()if k < '0': breakresult = 10 * result + k.ord - '0'.ordvar t = scan()var a = scan()var b = scan()if t < max(a,b) : quit "NO",0if a == 0 and b == 0 and t == 1:quit "NO",0printf("YES\n")if a == 0 and b == 0 and t mod 2 == 1:printf(">\n^\n<v\n")t -= 3let m = max(a,b) + 2while t >= m:printf(">\n<\n")t -= 2# put('>')# put('\n')# put('<')# put('\n')if t == max(a,b) + 1:# 斜めのところか 上に登るところで一回余裕を挟むif a == b :printf(">\n^\n")a -= 1b -= 1elif a > b:printf("^>\n<\n")a -= 1else :printf("^>\nv\n")b -= 1t -= 2min(a,b).times:printf(">^\n")# put('>')# put('^')# put('\n')if a > b:(a-b).times:printf("^\n")# put('^')# put('\n')elif b > a:(b-a).times:printf(">\n")# put('>')# put('\n')