結果

問題 No.232 めぐるはめぐる (2)
ユーザー 👑 tatt61880tatt61880
提出日時 2019-03-18 18:49:31
言語 Kuin
(KuinC++ v.2021.9.17)
結果
WA  
実行時間 -
コード長 870 bytes
コンパイル時間 2,296 ms
コンパイル使用メモリ 154,412 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-14 15:25:55
合計ジャッジ時間 4,757 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
4,348 KB
testcase_01 AC 45 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,348 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2 ms
4,352 KB
testcase_17 AC 2 ms
4,348 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var _: [][]char :: cui@input().split(" ")
	var T: int :: _[0].toInt(&)
	var A: int :: _[1].toInt(&)
	var B: int :: _[2].toInt(&)
	var ans: bool :: true
	if(A.abs() > T | B.abs() > T)
		do ans :: false
	end if
	if(T = 1 & A = 0 & B = 0)
		do ans :: false
	end if
	if(!ans)
		do cui@print("NO\n")
		ret
	end if
	do cui@print("YES\n")
	var x: int
	var y: int
	for t(1, T)
		if(t = 1 & (T - A) % 2 <> 0)
			do y :+ moveY(B - y > 0 ?(1, -1))
			do cui@print("\n")
			skip t
		end if
		if(t = T & (T - B) % 2 <> 0)
			do x :+ moveX(A - x > 0 ?(1, -1))
			do cui@print("\n")
			skip t
		end if
		do x :+ moveX(A - x > 0 ?(1, -1))
		do y :+ moveY(B - y > 0 ?(1, -1))
		do cui@print("\n")
	end for
	func moveY(dy: int): int
		do cui@print(dy = 1 ?("^", "v"))
		ret dy
	end func
	func moveX(dx: int): int
		do cui@print(dx = 1 ?(">", "<"))
		ret dx
	end func
end func
0