結果
| 問題 |
No.1292 パタパタ三角形
|
| コンテスト | |
| ユーザー |
Kite_kuma
|
| 提出日時 | 2020-11-20 21:49:55 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 557 bytes |
| コンパイル時間 | 247 ms |
| コンパイル使用メモリ | 82,420 KB |
| 実行使用メモリ | 102,428 KB |
| 最終ジャッジ日時 | 2024-07-23 12:52:58 |
| 合計ジャッジ時間 | 2,165 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 WA * 11 |
ソースコード
s = input()
x = 0
y = 0
cnt = 0
se = set()
se.add((0, 0))
for c in s:
t = 0
if c == 'b':
t = 1
elif c == 'c':
t = 2
if cnt % 2 == 0:
now = -x + 2 * t
now %= 3
if now == 0:
y -= 1
if now == 2:
x += 1
if now == 1:
x -= 1
else:
now = y * 3 + t * 2-x
now %= 3
if now == 1:
x += 1
if now == 2:
x -= 1
if now == 0:
y += 1
se.add((x, y))
cnt += 1
print(len(se))
Kite_kuma