結果

問題 No.232 めぐるはめぐる (2)
ユーザー convexineqconvexineq
提出日時 2021-01-31 17:53:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,330 bytes
コンパイル時間 981 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 77,984 KB
最終ジャッジ日時 2023-09-11 11:54:43
合計ジャッジ時間 5,341 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 107 ms
77,172 KB
testcase_02 WA -
testcase_03 AC 94 ms
77,228 KB
testcase_04 AC 72 ms
71,376 KB
testcase_05 AC 75 ms
71,244 KB
testcase_06 AC 73 ms
71,404 KB
testcase_07 AC 76 ms
71,232 KB
testcase_08 WA -
testcase_09 AC 73 ms
71,400 KB
testcase_10 WA -
testcase_11 AC 73 ms
71,588 KB
testcase_12 AC 73 ms
71,336 KB
testcase_13 AC 73 ms
71,112 KB
testcase_14 AC 73 ms
71,336 KB
testcase_15 AC 74 ms
71,420 KB
testcase_16 AC 75 ms
71,244 KB
testcase_17 AC 74 ms
71,516 KB
testcase_18 WA -
testcase_19 AC 75 ms
71,444 KB
testcase_20 AC 74 ms
71,320 KB
testcase_21 AC 73 ms
71,224 KB
testcase_22 AC 76 ms
71,428 KB
testcase_23 AC 74 ms
71,376 KB
testcase_24 AC 74 ms
71,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t,b,a = map(int,input().split())
if t < max(a,b) or t==1 and a==b==0:
    print("NO")
    exit()
print("YES")
d = dict(zip(range(8),[">",">^","^","^<","<","<v","v","v>",]))

def f(a,b):
    if a>0 and b==0: return 0
    if a>0 and b>0: return 1
    if a==0 and b>0: return 2
    if a<0 and b>0: return 3
    if a<0 and b==0: return 4
    if a<0 and b<0: return 5
    if a==0 and b<0: return 6
    if a>0 and b<0: return 7
    if a==b==0: return 8

while t > 2:
    if a >= 0 and b >= 0:
        c = f(a,b)
        print(d[c%8])
    if a < 0: a += 1
    elif a > 0: a -= 1
    if b < 0: b += 1
    elif b > 0: b -= 1
    if c==8:
        a -= 1
    t -= 1

if t==2:
    c = -1
    if a==1 and b==0:
        c = 2
        b -= 1
    elif a==1 and b>0:
        c = 0
        a -= 1
    elif a==0 and b==1:
        c = 0
        a -= 1
    elif a==-1 and b==1:
        c = 2
        b -= 1
    elif a==-1 and b==0:
        c = 2
        b -= 1
    elif a==-1 and b==-1:
        c = 6
        b += 1
    elif a==0 and b==-1:
        c = 0
        a -= 1
    elif a==1 and b==-1:
        c = 0
        a -= 1
    else:
        c = f(a,b)
        if a < 0: a += 1
        elif a > 0: a -= 1
        if b < 0: b += 1
        elif b > 0: b -= 1
        if c==8:
            a -= 1
        
    #print(c)
    print(d[c%8])

print(d[f(a,b)])
0