結果

問題 No.232 めぐるはめぐる (2)
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-06-30 13:39:08
言語 Python2
(2.7.18)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,028 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 6,680 KB
実行使用メモリ 11,796 KB
最終ジャッジ日時 2023-09-22 04:41:00
合計ジャッジ時間 2,811 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,396 KB
testcase_01 AC 31 ms
11,796 KB
testcase_02 AC 15 ms
7,536 KB
testcase_03 AC 29 ms
11,676 KB
testcase_04 AC 12 ms
5,956 KB
testcase_05 AC 12 ms
6,092 KB
testcase_06 AC 12 ms
5,916 KB
testcase_07 AC 11 ms
5,908 KB
testcase_08 AC 25 ms
9,856 KB
testcase_09 AC 12 ms
5,956 KB
testcase_10 AC 12 ms
5,936 KB
testcase_11 AC 13 ms
5,916 KB
testcase_12 AC 12 ms
5,976 KB
testcase_13 WA -
testcase_14 AC 12 ms
6,004 KB
testcase_15 AC 12 ms
6,064 KB
testcase_16 AC 12 ms
5,932 KB
testcase_17 AC 13 ms
5,936 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 12 ms
5,904 KB
testcase_22 AC 12 ms
5,956 KB
testcase_23 AC 12 ms
5,912 KB
testcase_24 AC 12 ms
6,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
from itertools import izip_longest

H, J, K, L = list('<v^>')

def solve(t, a, b):
    if (t, a, b) == (1, 0, 0):
        return None
    elif (t, a, b) == (1, 0, 1):
        return [L]
    elif (t, a, b) == (1, 1, 0):
        return [K]
    elif (t, a, b) == (1, 1, 1):
        return [K+L]
    elif (t, a, b) == (2, 0, 1):
        return [K+L, J]
    elif (t, a, b) == (2, 1, 0):
        return [K+L, H]
    elif (t, a, b) == (2, 0, 0):
        return [L, H]
    elif (t, a, b) == (2, 1, 1):
        return [L, K]
    dist = max(a, b)
    if t < dist:
        return None
    res = map(''.join, izip_longest(K*a, L*b, fillvalue=''))
    left = t - dist
    res += [H, L] * (left / 2)
    if not (left & 1):
        return res
    for i, e in enumerate(res):
        if len(e) < 2:
            continue
        res += e[0] + e[1]
        del res[i]
        break
    return res

t, a, b = map(int, raw_input().split())
res = solve(t, a, b)
if res:
    print 'YES'
    print '\n'.join(res)
else:
    print 'NO'
0