結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
5,248 KB
testcase_01 AC 7 ms
5,376 KB
testcase_02 AC 8 ms
5,376 KB
testcase_03 AC 7 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 6 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 WA -
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 1 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
  if b == -1 then
    print("<")
    t = t - 1
  else
    for i = 1, b do
      print(">")
    end
    t = t - b
  end
  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
  if a == -1 then
    print("v")
    t = t - 1
  else
    for i = 1, a do
      print("^")
    end
    t = t - a
  end
  local ht = t / 2
  for i = 1, ht do
    print(">") print("<")
  end
end
0