結果

問題 No.232 めぐるはめぐる (2)
ユーザー 👑 rin204rin204
提出日時 2022-07-12 13:41:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 707 bytes
コンパイル時間 461 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 79,024 KB
最終ジャッジ日時 2023-09-05 14:41:34
合計ジャッジ時間 6,721 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

t, a, b = map(int, input().split())
if a > t or b > t:
    print("NO")
    exit()
if t == 1 and a == b == 0:
    print("NO")
    exit()

upp = [0] * t
rig = [0] * t
for i in range(a):
    upp[i] = 1
for i in range(b):
    rig[i] = 1

ma = max(a, b)
x = t - ma
for i in range(ma, t - 1, 2):
    upp[i] = 1
    upp[i + 1] = 2

if x & 1:
    if upp[0] != 0 and rig[0] != 0:
        upp[-1] = upp[0]
        upp[0] = 0
    elif upp[0] == 0:
        upp[0] = 1
        upp[-1] = 2
    else:
        rig[0] = 1
        rig[-1] = 2
for u, r in zip(upp, rig):
    S = ""
    if u == 1:
        S += "^"
    elif u == 2:
        S += "v"
    if r == 1:
        S += ">"
    elif r == 2:
        S += "<"
    print(S)
0