結果

問題 No.232 めぐるはめぐる (2)
ユーザー convexineqconvexineq
提出日時 2021-01-31 17:59:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 1,000 ms
コード長 1,296 bytes
コンパイル時間 443 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 77,668 KB
最終ジャッジ日時 2023-10-12 13:53:50
合計ジャッジ時間 3,967 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
77,180 KB
testcase_01 AC 94 ms
77,164 KB
testcase_02 AC 101 ms
76,836 KB
testcase_03 AC 93 ms
77,104 KB
testcase_04 AC 70 ms
71,404 KB
testcase_05 AC 72 ms
71,084 KB
testcase_06 AC 70 ms
71,340 KB
testcase_07 AC 72 ms
71,080 KB
testcase_08 AC 118 ms
77,668 KB
testcase_09 AC 72 ms
71,404 KB
testcase_10 AC 73 ms
71,292 KB
testcase_11 AC 72 ms
71,304 KB
testcase_12 AC 71 ms
71,172 KB
testcase_13 AC 71 ms
71,324 KB
testcase_14 AC 71 ms
71,196 KB
testcase_15 AC 72 ms
71,420 KB
testcase_16 AC 70 ms
71,192 KB
testcase_17 AC 70 ms
71,368 KB
testcase_18 AC 79 ms
75,236 KB
testcase_19 AC 70 ms
71,280 KB
testcase_20 AC 72 ms
71,232 KB
testcase_21 AC 71 ms
71,244 KB
testcase_22 AC 72 ms
71,256 KB
testcase_23 AC 72 ms
71,416 KB
testcase_24 AC 71 ms
71,196 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:
    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