結果

問題 No.232 めぐるはめぐる (2)
ユーザー convexineqconvexineq
提出日時 2021-01-31 17:49:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,311 bytes
コンパイル時間 1,656 ms
コンパイル使用メモリ 87,100 KB
実行使用メモリ 78,824 KB
最終ジャッジ日時 2023-09-11 11:50:35
合計ジャッジ時間 6,286 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 98 ms
76,984 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 76 ms
71,388 KB
testcase_05 RE -
testcase_06 AC 78 ms
71,228 KB
testcase_07 AC 76 ms
71,184 KB
testcase_08 WA -
testcase_09 AC 76 ms
71,368 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 75 ms
71,536 KB
testcase_13 AC 75 ms
71,352 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 77 ms
71,536 KB
testcase_17 AC 78 ms
71,244 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 76 ms
71,124 KB
testcase_22 AC 74 ms
71,328 KB
testcase_23 AC 75 ms
71,320 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

t,a,b = map(int,input().split())
if t < max(a,b):
    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