結果

問題 No.1292 パタパタ三角形
ユーザー chineristACchineristAC
提出日時 2020-11-20 21:43:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 929 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 126,548 KB
最終ジャッジ日時 2023-09-30 19:05:24
合計ジャッジ時間 3,479 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,488 KB
testcase_01 AC 77 ms
71,308 KB
testcase_02 AC 78 ms
71,456 KB
testcase_03 AC 78 ms
71,552 KB
testcase_04 AC 78 ms
71,440 KB
testcase_05 AC 81 ms
75,120 KB
testcase_06 AC 77 ms
75,032 KB
testcase_07 AC 182 ms
86,976 KB
testcase_08 AC 177 ms
85,808 KB
testcase_09 AC 206 ms
124,048 KB
testcase_10 AC 208 ms
126,440 KB
testcase_11 AC 211 ms
126,548 KB
testcase_12 AC 167 ms
109,672 KB
testcase_13 AC 162 ms
109,796 KB
testcase_14 AC 126 ms
77,252 KB
testcase_15 AC 131 ms
77,252 KB
testcase_16 AC 128 ms
77,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def pata(x,s):
    if x[0]=="U":
        if x[1]==s:
            p = (x[6][0]+3,x[6][1]+1)
            res = ("D",x[3],x[2],x[1],x[4],p,x[5])
        elif x[2]==s:
            p = (x[4][0],x[4][1]-2)
            res = ("D",x[2],x[1],x[3],x[6],x[5],p)
        else:
            #print(x[5])
            p = (x[5][0]-3,x[5][1]+1)
            res = ("D",x[1],x[3],x[2],p,x[4],x[6])
    else:
        if x[1]==s:
            p = (x[6][0],x[6][1]+2)
            res = ("U",x[2],x[1],x[3],p,x[5],x[4])
        elif x[2]==s:
            p = (x[4][0]+3,x[4][1]-1)
            res = ("U",x[1],x[3],x[2],x[5],p,x[6])
        else:
            p = (x[5][0]-3,x[5][1]-1)
            res = ("U",x[3],x[2],x[1],x[4],x[6],p)
    return res

val = set([("U","a","b","c",(1,1),(2,0),(0,0))])
pos = ("U","a","b","c",(1,1),(2,0),(0,0))

S = input()
for i in range(len(S)):
    pos = pata(pos,S[i])
    val.add(pos)
    #print(pos)

print(len(val))
0