結果
| 問題 | No.1292 パタパタ三角形 |
| コンテスト | |
| ユーザー |
Kite_kuma
|
| 提出日時 | 2020-11-20 21:56:38 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 119 ms / 2,000 ms |
| + 104µs | |
| コード長 | 601 bytes |
| 記録 | |
| コンパイル時間 | 257 ms |
| コンパイル使用メモリ | 96,236 KB |
| 実行使用メモリ | 115,456 KB |
| 最終ジャッジ日時 | 2026-08-24 01:50:32 |
| 合計ジャッジ時間 | 3,287 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
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:
if cnt % 2 == 0:
y -= 1
else:
y += 1
if now == 2:
x += 1
if now == 1:
x -= 1
# # else:
# now = t * 2-x
# now %= 3
# if now == 0:
# y += 1
# if now == 1:
# x += 1
# if now == 2:
# x -= 1
se.add((x, y))
cnt += 1
print(len(se))
Kite_kuma