結果

問題 No.1292 パタパタ三角形
ユーザー 👑 H20H20
提出日時 2020-11-20 21:39:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 341 bytes
コンパイル時間 249 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 122,024 KB
最終ジャッジ日時 2023-09-30 19:03:11
合計ジャッジ時間 2,835 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,176 KB
testcase_01 AC 72 ms
71,164 KB
testcase_02 AC 71 ms
71,340 KB
testcase_03 AC 71 ms
71,304 KB
testcase_04 AC 71 ms
71,064 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 138 ms
121,952 KB
testcase_13 AC 138 ms
122,024 KB
testcase_14 AC 102 ms
90,696 KB
testcase_15 AC 105 ms
90,492 KB
testcase_16 AC 103 ms
90,504 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
    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