結果

問題 No.1292 パタパタ三角形
ユーザー 👑 KazunKazun
提出日時 2020-11-20 21:37:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 517 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 86,820 KB
実行使用メモリ 100,368 KB
最終ジャッジ日時 2023-09-30 19:02:41
合計ジャッジ時間 2,749 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,232 KB
testcase_01 AC 73 ms
71,228 KB
testcase_02 AC 72 ms
71,240 KB
testcase_03 AC 73 ms
71,176 KB
testcase_04 AC 72 ms
71,236 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 134 ms
100,368 KB
testcase_13 AC 129 ms
97,896 KB
testcase_14 AC 91 ms
76,692 KB
testcase_15 WA -
testcase_16 AC 92 ms
76,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S=input();N=len(S)

X={(0,0)}
u,d,l,r="a","*","b","c"

x,y=0,0
for s in S:
    if (x+y)%2==0:
        if s==u:
            y+=1
            u,d=d,u
        elif s==l:
            x-=1
            u,d,l,r="*",r,u,l
        elif s==r:
            x+=1
            u,d,l,r="*",l,r,u
    elif (x+y)%2==1:
        if s==d:
            y-=1
            u,d=d,u
        elif s==l:
            x-=1
            u,d,l,r=r,"*",d,l
        elif s==r:
            x+-1
            u,d,l,r=l,"*",r,d
    X.add((x,y))
print(len(X))
0