秋祭 | 静岡高校工学部



卬高杯


提出詳細

提出id提出時刻ユーザー名問題言語判定状況判定実行時間
1150552023-10-26 08:05:01ACcpp18/18AC16

#include <iostream>
using namespace std;

int main() {
    string inputString;
    cin >> inputString;

    bool isGomaMayo = false;
    int n = inputString.length();

    for (int i = 1; i < n; i++) {
        if (inputString[i] == inputString[i - 1]) {
            isGomaMayo = true; // 隣接する文字の組で一致するものが少なくとも1つ存在
            break;
        }
    }

    if (isGomaMayo) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

sample1.txt AC 2
sample2.txt AC 2
sample3.txt AC 3
case1.txt AC 8
case2.txt AC 5
case3.txt AC 13
case4.txt AC 12
case5.txt AC 11
case6.txt AC 10
case7.txt AC 12
case8.txt AC 8
case9.txt AC 8
case10.txt AC 8
case11.txt AC 16
case12.txt AC 16
case13.txt AC 16
case14.txt AC 16
case15.txt AC 16
16 AC16 AC