結果
| 問題 | No.3655 Adjacent Pairs in Triplets |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-30 13:43:46 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 731 ms / 2,000 ms |
| + 243µs | |
| コード長 | 396 bytes |
| 記録 | |
| コンパイル時間 | 1,109 ms |
| コンパイル使用メモリ | 209,872 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-30 13:44:08 |
| 合計ジャッジ時間 | 11,785 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
string s; cin >> s;
ll ans = 0;
cerr << s << endl;
for(ll i=0; i<=s.length()-3; i++){
cerr << s[i] << s[i+1] << s[i+2] << " ";
if((s[i] == s[i+1] && s[i+1] != s[i+2]) || (s[i] != s[i+1] && s[i+1] == s[i+2])){
ans++;
cerr << "good";
}
cerr << endl;
}
cout << ans << endl;
}