結果

問題 No.232 めぐるはめぐる (2)
ユーザー yaoshimax
提出日時 2015-06-27 20:51:49
言語 Python2
(2.7.18)
結果
AC  
実行時間 64 ms / 1,000 ms
コード長 762 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 9,472 KB
最終ジャッジ日時 2024-09-14 12:34:02
合計ジャッジ時間 1,815 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

T,A,B=map(int,raw_input().split())
if A>T or B>T:
    print "NO"
elif A==0 and B==0 and T==1:
    print "NO"
else:
    print "YES"
    if A==0 and B==0:
        print "v"
        A+=1
        T-=1
    for i in range(T):
        if A==0:
            if B==1 and i != T-1:
                print "v"
                A+=1
            else:
                print ">"
                B-=1
        elif B==0:
            if A==1 and i != T-1:
                print "<"
                B+=1
            else:
                print "^"
                A-=1
        elif A==1 and B==1:
            if i==T-1:
                print "^>"
            else:
                print ">"
                B-=1
        else:
            print "^>"
            A-=1
            B-=1
0