結果
| 問題 | No.3655 Adjacent Pairs in Triplets |
| コンテスト | |
| ユーザー |
tau1235
|
| 提出日時 | 2026-08-30 13:35:32 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| + 927µs | |
| コード長 | 251 bytes |
| 記録 | |
| コンパイル時間 | 2,134 ms |
| コンパイル使用メモリ | 332,828 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-30 13:36:26 |
| 合計ジャッジ時間 | 3,228 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int n=s.size();
int ans=0;
for (int i=0;i<n-2;i++){
char c1=s[i],c2=s[i+1],c3=s[i+2];
if ((c1==c2&&c2!=c3)||(c2==c3&&c1!=c2)) ans++;
}
cout<<ans<<endl;
}
tau1235