結果

問題 No.232 めぐるはめぐる (2)
ユーザー 👑 obakyanobakyan
提出日時 2020-04-23 09:15:11
言語 Lua
(LuaJit 2.1.1696795921)
結果
WA  
実行時間 -
コード長 678 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 5,120 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-21 07:25:51
合計ジャッジ時間 1,868 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

local t, a, b = io.read("*n", "*n", "*n")
if t < a or t < b then
  print("NO")
  os.exit()
end
print("YES")
local c = math.min(a, b)
for i = 1, c do
  print("^>")
end
t = t - c
a = a - c
b = b - c
if t == 0 then
  os.exit()
end
if a == 0 then
  if (t - b) % 2 == 1 then
    print("^>")
    print("v")
    b = b - 1
    t = t - 2
  end
  for i = 1, b do
    print(">")
  end
  t = t - b
  local ht = t / 2
  for i = 1, ht do
    print(">") print("<")
  end
else
  if (t - a) % 2 == 1 then
    print("^>")
    print("<")
    a = a - 1
    t = t - 2
  end
  for i = 1, a do
    print("^")
  end
  t = t - a
  local ht = t / 2
  for i = 1, ht do
    print(">") print("<")
  end
end
0