結果

問題 No.1292 パタパタ三角形
ユーザー tktk_snsntktk_snsn
提出日時 2020-11-20 22:19:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 521 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 10,828 KB
実行使用メモリ 41,560 KB
最終ジャッジ日時 2023-09-30 19:28:07
合計ジャッジ時間 3,041 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,932 KB
testcase_01 AC 16 ms
7,832 KB
testcase_02 AC 15 ms
7,932 KB
testcase_03 AC 15 ms
7,832 KB
testcase_04 AC 16 ms
7,944 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 252 ms
41,488 KB
testcase_13 AC 243 ms
41,560 KB
testcase_14 AC 136 ms
8,500 KB
testcase_15 AC 141 ms
8,412 KB
testcase_16 AC 172 ms
8,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()

da = [1, 0]
db = [0, 1]
dc = [-1, -1]
nx = 0
ny = 0

memo = set()
memo.add((nx, ny))
for s in S:
    if s == "a":
        dx, dy = da
        da[0] *= -1
        db[0] *= -1
        dc[0] *= -1
    elif s == "b":
        dx, dy = db
        da[1] *= -1
        db[1] *= -1
        dc[1] *= -1
    else:
        dx, dy = dc
        da[0] *= -1
        db[0] *= -1
        dc[0] *= -1
        da[1] *= -1
        db[1] *= -1
        dc[1] *= -1
    nx += dx
    ny += dy
    memo.add((nx, ny))
print(len(memo))
0