結果

問題 No.232 めぐるはめぐる (2)
ユーザー lloyzlloyz
提出日時 2023-09-16 19:46:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,639 bytes
コンパイル時間 592 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 77,440 KB
最終ジャッジ日時 2023-09-16 19:46:54
合計ジャッジ時間 4,829 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
77,024 KB
testcase_01 AC 88 ms
77,052 KB
testcase_02 AC 94 ms
77,068 KB
testcase_03 AC 95 ms
77,072 KB
testcase_04 AC 70 ms
71,068 KB
testcase_05 WA -
testcase_06 AC 70 ms
71,272 KB
testcase_07 AC 70 ms
71,048 KB
testcase_08 AC 115 ms
77,440 KB
testcase_09 AC 68 ms
71,452 KB
testcase_10 WA -
testcase_11 AC 68 ms
71,160 KB
testcase_12 AC 67 ms
71,052 KB
testcase_13 WA -
testcase_14 AC 68 ms
71,396 KB
testcase_15 AC 68 ms
71,220 KB
testcase_16 AC 68 ms
71,452 KB
testcase_17 AC 71 ms
71,140 KB
testcase_18 AC 75 ms
75,468 KB
testcase_19 AC 68 ms
71,176 KB
testcase_20 AC 70 ms
71,260 KB
testcase_21 AC 91 ms
71,192 KB
testcase_22 WA -
testcase_23 AC 69 ms
71,300 KB
testcase_24 AC 69 ms
71,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t, a, b = map(int, input().split())
if a > t or b > t:
    print("NO")
    exit()
print("YES")
aa = t - (t - a) % 2
bb = t - (t - b) % 2
ca, cb = 0, 0
if aa < t and bb < t:
    for i in range(t):
        if i == 0:
            print('^')
            ca += 1
        elif i == t - 1:
            if cb < b:
                print('>')
            else:
                if (cb - b) % 2 == 0:
                    res += '>'
                else:
                    res += '<'
            cb += 1
        else:
            res = ''
            if ca < a:
                res += '^'
            else:
                if (ca - a) % 2 == 0:
                    res += '^'
                else:
                    res += 'v'
            if cb < b:
                res += '>'
            else:
                if (cb - b) % 2 == 0:
                    res += '>'
                else:
                    res += '<'
            print(res)
            ca += 1
            cb += 1
else:
    for i in range(t):
        res = ''
        if i == 0:
            if aa == t:
                res += '^'
                ca += 1
            if bb == t:
                res += '>'
                cb += 1
        else:
            if ca < a:
                res += '^'
            else:
                if (ca - a) % 2 == 0:
                    res += '^'
                else:
                    res += 'v'
            if cb < b:
                res += '>'
            else:
                if (cb - b) % 2 == 0:
                    res += '>'
                else:
                    res += '<'
            ca += 1
            cb += 1
        print(res)
0