提出 #6519260


ソースコード 拡げる

#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;
}

提出情報

提出日時
問題 B - YYMM or MMYY
ユーザ rk018
言語 C++14 (GCC 5.4.1)
得点 200
コード長 601 Byte
結果 AC
実行時間 1 ms
メモリ 256 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 10
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
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