結果

問題 No.1292 パタパタ三角形
ユーザー 👑 H20H20
提出日時 2020-11-20 21:45:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 371 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 94,572 KB
最終ジャッジ日時 2023-09-30 19:05:45
合計ジャッジ時間 2,893 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,144 KB
testcase_01 AC 77 ms
71,364 KB
testcase_02 AC 76 ms
71,312 KB
testcase_03 AC 77 ms
71,252 KB
testcase_04 AC 76 ms
71,292 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 108 ms
90,616 KB
testcase_15 AC 109 ms
90,928 KB
testcase_16 AC 109 ms
90,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
x = 0 
y = 0
cnt = 0
a = -1
b = 1
c = -1
LIST = [(0,0)]
for i in range(len(S)):
    if S[i]=='a':
        y += a
        a = -a
        b = -b
        c = -c
    if S[i]=='b':
        x += b
        b = -b
        a = -a
        c = -c
    if S[i]=='c':
        x += c
        b = -b
        a = -a
        c = -c

    LIST.append((x,y))
print(len(set(LIST)))
0