結果

問題 No.232 めぐるはめぐる (2)
ユーザー maspymaspy
提出日時 2020-02-06 09:55:34
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 783 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 11,888 KB
実行使用メモリ 19,320 KB
最終ジャッジ日時 2023-10-25 08:43:15
合計ジャッジ時間 3,988 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
18,844 KB
testcase_01 AC 82 ms
18,720 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 29 ms
10,044 KB
testcase_05 AC 29 ms
10,044 KB
testcase_06 AC 29 ms
10,044 KB
testcase_07 AC 29 ms
10,044 KB
testcase_08 WA -
testcase_09 AC 28 ms
10,044 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 30 ms
10,044 KB
testcase_13 AC 29 ms
10,044 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 28 ms
10,044 KB
testcase_17 AC 29 ms
10,044 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 29 ms
10,044 KB
testcase_22 AC 29 ms
10,044 KB
testcase_23 AC 28 ms
10,044 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

class NotFoundError(Exception):
    pass

def solve_1_dim(T, A, words):
    if T < A:
        raise NotFoundError
    add = (T + A) // 2
    sub = add - A
    stay = T - add - sub
    return [''] * stay + [words[0]] * add + [words[1]] * sub

def solve(T, A, B):
    try:
        ans_A = solve_1_dim(T, A, '><')
        ans_B = solve_1_dim(T, B, '^v')
    except NotFoundError:
        print('NO')
    else:
        ans_B.reverse()
        if (not ans_A[0]) and (not ans_B[0]):
            print('NO')
        else:
            print('YES')
            print('\n'.join('{}{}'.format(*z) for z in zip(ans_A, ans_B)))

solve(T, A, B)
0