Submission #37150674


Source Code Expand

#include <bits/stdc++.h>

typedef  long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
using namespace std;
int main() {
    string S;
    
    cin >> S;
    int size = S.size();
            bool f = 1;
    if (size == 8) {
       
    }
    else {
        cout << "No" << endl;
        return 0;
    }
    if (S[0] >= 'A' && S[0] <= 'Z') {
     
    }
    else {
        cout << "No" << endl;
        return 0;
    }
    if (S[size-1] >= 'A' && S[size-1] <= 'Z') {

    }
    else {
        cout << "No" << endl;
        return 0;
    }
    string mid = S.substr(1, 6);
    //cout << mid << endl;
    if(mid[0]-'0'>=1&&mid[0]-'0'<=9){}
    else {
        cout << "No" << endl;
        return 0;
    }
    for (int i = 1; i < 6; i++) {
        if(mid[i] - '0' >= 0 && mid[i] - '0' <= 9){}
        else {
            cout << "No" << endl;
            return 0;
        }
    }
    if (f) {
        cout << "Yes" << endl;
    }
    else {
    
    }

}

Submission Info

Submission Time
Task B - Sandwich Number
User amaoto
Language C++ (GCC 9.2.1)
Score 200
Code Size 1035 Byte
Status AC
Exec Time 6 ms
Memory 3548 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 22
Set Name Test Cases
Sample 00_example_00.txt, 00_example_01.txt, 00_example_02.txt, 00_example_03.txt
All 00_example_00.txt, 00_example_01.txt, 00_example_02.txt, 00_example_03.txt, 01_hand_00.txt, 01_hand_01.txt, 01_hand_02.txt, 01_hand_03.txt, 02_killer_00.txt, 02_killer_01.txt, 02_killer_02.txt, 02_killer_03.txt, 03_max_00.txt, 03_max_01.txt, 04_min_00.txt, 04_min_01.txt, 05_random_00.txt, 05_random_01.txt, 05_random_02.txt, 06_yes_00.txt, 06_yes_01.txt, 06_yes_02.txt
Case Name Status Exec Time Memory
00_example_00.txt AC 6 ms 3548 KiB
00_example_01.txt AC 2 ms 3548 KiB
00_example_02.txt AC 3 ms 3452 KiB
00_example_03.txt AC 2 ms 3400 KiB
01_hand_00.txt AC 2 ms 3452 KiB
01_hand_01.txt AC 2 ms 3360 KiB
01_hand_02.txt AC 2 ms 3456 KiB
01_hand_03.txt AC 2 ms 3448 KiB
02_killer_00.txt AC 2 ms 3500 KiB
02_killer_01.txt AC 2 ms 3452 KiB
02_killer_02.txt AC 2 ms 3448 KiB
02_killer_03.txt AC 2 ms 3452 KiB
03_max_00.txt AC 2 ms 3460 KiB
03_max_01.txt AC 2 ms 3408 KiB
04_min_00.txt AC 1 ms 3548 KiB
04_min_01.txt AC 3 ms 3544 KiB
05_random_00.txt AC 3 ms 3452 KiB
05_random_01.txt AC 3 ms 3452 KiB
05_random_02.txt AC 2 ms 3456 KiB
06_yes_00.txt AC 2 ms 3408 KiB
06_yes_01.txt AC 2 ms 3408 KiB
06_yes_02.txt AC 2 ms 3496 KiB