Submission #49449401


Source Code Expand

// #include <atcoder/all>
#include <bits/stdc++.h>

using namespace std;
// using namespace atcoder;

int main() {
    string s;
    cin >> s;
    char m_ch = s[0];

    bool succ = true;
    for(auto &ch : s) {
        if(ch != m_ch) {
            if(ch != m_ch + 1 && ch != m_ch + 2) {
                succ = false;
                break;
            } else {
                m_ch = ch;
            }
        }
    }
    if(succ) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Submission Info

Submission Time
Task B - Extended ABC
User nnth_y
Language C++ 20 (gcc 12.2)
Score 200
Code Size 561 Byte
Status AC
Exec Time 1 ms
Memory 3644 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 33
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 01_handmade_08.txt, 01_handmade_09.txt, 01_handmade_10.txt, 01_handmade_11.txt, 01_handmade_12.txt, 01_handmade_13.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 02_random_15.txt, 02_random_16.txt, 02_random_17.txt, 02_random_18.txt, 02_random_19.txt, 02_random_20.txt, 02_random_21.txt, 02_random_22.txt, 02_random_23.txt, 02_random_24.txt, 02_random_25.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3472 KiB
00_sample_01.txt AC 1 ms 3464 KiB
00_sample_02.txt AC 1 ms 3532 KiB
00_sample_03.txt AC 1 ms 3464 KiB
01_handmade_04.txt AC 1 ms 3556 KiB
01_handmade_05.txt AC 1 ms 3460 KiB
01_handmade_06.txt AC 1 ms 3460 KiB
01_handmade_07.txt AC 1 ms 3424 KiB
01_handmade_08.txt AC 1 ms 3532 KiB
01_handmade_09.txt AC 1 ms 3484 KiB
01_handmade_10.txt AC 1 ms 3468 KiB
01_handmade_11.txt AC 1 ms 3644 KiB
01_handmade_12.txt AC 1 ms 3436 KiB
01_handmade_13.txt AC 1 ms 3464 KiB
02_random_07.txt AC 1 ms 3468 KiB
02_random_08.txt AC 1 ms 3496 KiB
02_random_09.txt AC 1 ms 3564 KiB
02_random_10.txt AC 1 ms 3488 KiB
02_random_11.txt AC 1 ms 3428 KiB
02_random_12.txt AC 1 ms 3460 KiB
02_random_13.txt AC 1 ms 3520 KiB
02_random_14.txt AC 1 ms 3464 KiB
02_random_15.txt AC 1 ms 3464 KiB
02_random_16.txt AC 1 ms 3492 KiB
02_random_17.txt AC 1 ms 3520 KiB
02_random_18.txt AC 1 ms 3560 KiB
02_random_19.txt AC 1 ms 3424 KiB
02_random_20.txt AC 1 ms 3516 KiB
02_random_21.txt AC 1 ms 3440 KiB
02_random_22.txt AC 1 ms 3428 KiB
02_random_23.txt AC 1 ms 3484 KiB
02_random_24.txt AC 1 ms 3440 KiB
02_random_25.txt AC 1 ms 3492 KiB