結果

問題 No.232 めぐるはめぐる (2)
ユーザー 👑 tatt61880tatt61880
提出日時 2019-03-19 00:33:40
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 48 ms / 1,000 ms
コード長 906 bytes
コンパイル時間 2,411 ms
コンパイル使用メモリ 154,400 KB
実行使用メモリ 4,356 KB
最終ジャッジ日時 2023-10-14 15:26:08
合計ジャッジ時間 4,106 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

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")
	else
		do cui@print("YES\n")
		var x: int :: 0
		var y: int :: 0
		for t(1, T)
			if(t = 1 & (T - B) % 2 <> 0)
				do y :+ moveY(A - y > 0 ?(1, -1))
				do cui@print("\n")
				skip t
			end if
			if(t = T & (T - A) % 2 <> 0)
				do x :+ moveX(B - x > 0 ?(1, -1))
				do cui@print("\n")
				skip t
			end if
			do x :+ moveX(B - x > 0 ?(1, -1))
			do y :+ moveY(A - 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 if
end func
0