結果

問題 No.1292 パタパタ三角形
ユーザー AEnAEn
提出日時 2022-12-10 00:00:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 217 ms / 2,000 ms
コード長 654 bytes
コンパイル時間 422 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 115,712 KB
最終ジャッジ日時 2024-04-22 23:21:02
合計ジャッジ時間 3,080 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,968 KB
testcase_01 AC 39 ms
52,096 KB
testcase_02 AC 39 ms
52,096 KB
testcase_03 AC 39 ms
51,968 KB
testcase_04 AC 38 ms
52,480 KB
testcase_05 AC 38 ms
52,480 KB
testcase_06 AC 39 ms
51,968 KB
testcase_07 AC 162 ms
83,840 KB
testcase_08 AC 145 ms
83,728 KB
testcase_09 AC 213 ms
115,712 KB
testcase_10 AC 211 ms
114,936 KB
testcase_11 AC 217 ms
114,688 KB
testcase_12 AC 199 ms
112,532 KB
testcase_13 AC 197 ms
112,652 KB
testcase_14 AC 115 ms
76,288 KB
testcase_15 AC 111 ms
76,288 KB
testcase_16 AC 108 ms
76,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
res = set()
posi = [0,0,0]
res.add(tuple(posi))
al = ['a','c','b',1]
for i in range(len(S)):
    id = al.index(S[i])
    if al[-1]==1:
        if id==0:
            posi[1]+=2
            al[0],al[1],al[2] = al[1],al[2],al[0]
        elif id==1:
            posi[2]+=2
        else:
            posi[0]+=2
            al[0],al[1],al[2] = al[2],al[0],al[1]
    else:
        if id==0:
            posi[0]-=2
            al[0],al[1],al[2] = al[1],al[2],al[0]
        elif id==1:
            posi[2]-=2
        else:
            posi[1]-=2
            al[0],al[1],al[2] = al[2],al[0],al[1]
    al[-1]*=-1
    res.add(tuple(posi))
print(len(res))
0