結果

問題 No.232 めぐるはめぐる (2)
ユーザー steek79steek79
提出日時 2015-11-19 00:17:35
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 1,014 bytes
コンパイル時間 623 ms
コンパイル使用メモリ 6,524 KB
実行使用メモリ 7,412 KB
最終ジャッジ日時 2023-10-11 18:02:23
合計ジャッジ時間 4,371 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
7,412 KB
testcase_01 AC 38 ms
6,504 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 11 ms
6,004 KB
testcase_05 AC 11 ms
5,944 KB
testcase_06 AC 11 ms
5,948 KB
testcase_07 AC 11 ms
6,024 KB
testcase_08 WA -
testcase_09 AC 11 ms
6,020 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 11 ms
5,948 KB
testcase_13 AC 11 ms
6,016 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 10 ms
5,896 KB
testcase_17 AC 10 ms
5,876 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 11 ms
5,876 KB
testcase_22 AC 11 ms
5,944 KB
testcase_23 AC 11 ms
5,920 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

T, A, B = map(int, raw_input().split())

short = min(A, B)

if T < A or T < B:
    route = None
elif (A, B) == (0, 0):
    if T == 1:
        route = None
    elif T%2 == 0:
        route = ['^'] * (T/2) + ['v'] * (T/2)
    else:
        route = ['^', '>', 'v<']
        route.extend(['^'] * ((T-3)/2))
        route.extend(['v'] * ((T-3)/2))
else:
    if short <= T:
        route = ['^>'] * short
        if A < B:
            route.extend(['^'] * (B-A))
        elif A > B:
            route.extend(['>'] * (A-B))

        restT = T - max(A, B)

        if restT == 1:
            del route[0]
            route.extend(['^', '>'])
        elif restT%2 == 0:
            route.extend(['^'] * (restT/2))
            route.extend(['v'] * (restT/2))
        else:
            route.extend(['^', '>', 'v<'])
            route.extend(['^'] * ((T-3)/2))
            route.extend(['v'] * ((T-3)/2))
    else:
        route = None

if route:
    print 'YES'
    for item in route:
        print item
else:
    print 'NO'
0