Submission #6519260
Source Code Expand
#include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
cin >> s;
int a = stoi(s.substr(0, 2));
int b = stoi(s.substr(2,4));
bool f_a = false;
bool f_b = false;
if (1 <= a && a <= 12) {
f_a = true;
}
if (1 <= b && b <= 12) {
f_b = true;
}
if (f_a && f_b) {
cout << "AMBIGUOUS" << endl;
} else if (f_a && !f_b) {
cout << "MMYY" << endl;
} else if (!f_a && f_b) {
cout << "YYMM" << endl;
} else {
cout << "NA" << endl;
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - YYMM or MMYY |
| User | rk018 |
| Language | C++14 (GCC 5.4.1) |
| Score | 200 |
| Code Size | 601 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 256 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 01.txt, 02.txt, 03.txt |
| All | 01.txt, 02.txt, 03.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 1 ms | 256 KiB |
| 02.txt | AC | 1 ms | 256 KiB |
| 03.txt | AC | 1 ms | 256 KiB |
| 11.txt | AC | 1 ms | 256 KiB |
| 12.txt | AC | 1 ms | 256 KiB |
| 13.txt | AC | 1 ms | 256 KiB |
| 14.txt | AC | 1 ms | 256 KiB |
| 15.txt | AC | 1 ms | 256 KiB |
| 16.txt | AC | 1 ms | 256 KiB |
| 17.txt | AC | 1 ms | 256 KiB |