結果
| 問題 | No.1292 パタパタ三角形 |
| コンテスト | |
| ユーザー |
Kite_kuma
|
| 提出日時 | 2020-11-20 21:49:55 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 557 bytes |
| 記録 | |
| コンパイル時間 | 114 ms |
| コンパイル使用メモリ | 85,116 KB |
| 実行使用メモリ | 103,848 KB |
| 最終ジャッジ日時 | 2026-04-03 14:24:46 |
| 合計ジャッジ時間 | 1,602 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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