結果

問題 No.232 めぐるはめぐる (2)
ユーザー maspy
提出日時 2020-02-06 09:55:34
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 783 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 18,512 KB
最終ジャッジ日時 2024-09-25 03:50:09
合計ジャッジ時間 4,023 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 11
権限があれば一括ダウンロードができます

ソースコード

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