結果

問題 No.1292 パタパタ三角形
ユーザー titiatitia
提出日時 2020-11-20 21:56:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 533 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 10,920 KB
実行使用メモリ 35,120 KB
最終ジャッジ日時 2023-09-30 19:11:31
合計ジャッジ時間 2,965 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,848 KB
testcase_01 AC 16 ms
7,828 KB
testcase_02 AC 16 ms
7,908 KB
testcase_03 AC 16 ms
7,924 KB
testcase_04 AC 15 ms
7,908 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 221 ms
32,844 KB
testcase_13 AC 220 ms
32,908 KB
testcase_14 AC 132 ms
8,436 KB
testcase_15 AC 132 ms
8,492 KB
testcase_16 AC 128 ms
8,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

S=input().strip()

NOW=[0,0]

PX="c"
MX="a"
Y="b"
plus = 0

DICT={(0,0)}

for s in S:
    if s==PX:
        NOW[0]+=1
        
        PX, MX, Y = Y, PX, MX
        plus = 1 - plus

    elif s==MX:
        NOW[0]-=1
        
        PX, MX, Y = MX, Y, PX
        plus = 1 - plus

    else:
        if plus == 0:
            NOW[1]-=1
        else:
            NOW[1]+=1

        PX, MX, Y = MX, PX, Y
        plus = 1 - plus

    DICT.add(tuple(NOW))

print(len(DICT))

        
        
    

0