結果
| 問題 | No.3655 Adjacent Pairs in Triplets |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-31 07:54:23 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0) |
| 結果 |
AC
|
| 実行時間 | 162 ms / 2,000 ms |
| + 84µs | |
| コード長 | 138 bytes |
| 記録 | |
| コンパイル時間 | 303 ms |
| コンパイル使用メモリ | 21,336 KB |
| 実行使用メモリ | 15,788 KB |
| 最終ジャッジ日時 | 2026-08-31 07:54:28 |
| 合計ジャッジ時間 | 4,448 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
s = input()
n, ans = len(s), 0
for i in range(n-2):
if (s[i] == s[i+1] or s[i+1] == s[i+2]) and s[i] != s[i+2]: ans += 1
print(ans)