Submission #37158291
Source Code Expand
#include <iostream>
#include <iomanip>
#include <limits>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cstdio>
#include <bitset>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <functional>
#include <stack>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <cassert>
#include <cstdlib>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = (1<<30)-1;
const int MOD = 1e9+7;
const ll LINF = (1ll<<62)-1;
#define REP(i,n) for(int i=0;i<(n);++i)
#define COUT(x) cout<<(x)<<"\n"
#define COUT16(x) cout << fixed << setprecision(16) << (x) << "\n"
int main(){
string s; cin >> s;
if(s.size() != 8){
COUT("No");
}
else{
bool flag = true;
if(!(65<=s[0] && s[0]<=90)){
flag = false;
}
if(!(65<=s[7] && s[7]<=90)){
flag = false;
}
bool finish = false;
for(int i=100000;i<=999999;i++){
if(s.substr(1,6) == to_string(i)){
finish = true;
break;
}
}
if(finish == false){
flag = false;
}
if(flag == true)COUT("Yes");
else COUT("No");
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Sandwich Number |
| User | Knots |
| Language | C++ (GCC 9.2.1) |
| Score | 200 |
| Code Size | 1530 Byte |
| Status | AC |
| Exec Time | 88 ms |
| Memory | 3620 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| 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 | 11 ms | 3612 KiB |
| 00_example_01.txt | AC | 2 ms | 3500 KiB |
| 00_example_02.txt | AC | 3 ms | 3480 KiB |
| 00_example_03.txt | AC | 88 ms | 3600 KiB |
| 01_hand_00.txt | AC | 83 ms | 3620 KiB |
| 01_hand_01.txt | AC | 2 ms | 3444 KiB |
| 01_hand_02.txt | AC | 2 ms | 3564 KiB |
| 01_hand_03.txt | AC | 2 ms | 3440 KiB |
| 02_killer_00.txt | AC | 10 ms | 3516 KiB |
| 02_killer_01.txt | AC | 8 ms | 3480 KiB |
| 02_killer_02.txt | AC | 12 ms | 3616 KiB |
| 02_killer_03.txt | AC | 86 ms | 3616 KiB |
| 03_max_00.txt | AC | 2 ms | 3352 KiB |
| 03_max_01.txt | AC | 2 ms | 3392 KiB |
| 04_min_00.txt | AC | 2 ms | 3552 KiB |
| 04_min_01.txt | AC | 2 ms | 3552 KiB |
| 05_random_00.txt | AC | 4 ms | 3448 KiB |
| 05_random_01.txt | AC | 2 ms | 3584 KiB |
| 05_random_02.txt | AC | 2 ms | 3440 KiB |
| 06_yes_00.txt | AC | 12 ms | 3500 KiB |
| 06_yes_01.txt | AC | 25 ms | 3520 KiB |
| 06_yes_02.txt | AC | 53 ms | 3620 KiB |