提出 #33959991


ソースコード 拡げる

use proconio::{input, marker::Chars};

fn main() {
    input! {
        s: Chars,
    };
    let yy = s[0..2].iter().collect::<String>().parse::<usize>().unwrap();
    let mm = s[2..4].iter().collect::<String>().parse::<usize>().unwrap();
    let ans = match ((1..=12).contains(&yy), (1..=12).contains(&mm)) {
        (true, true) => "AMBIGUOUS",
        (true, false) => "MMYY",
        (false, true) => "YYMM",
        (false, false) => "NA",
    };
    println!("{}", ans);
}

提出情報

提出日時
問題 B - YYMM or MMYY
ユーザ bouzuya
言語 Rust (1.42.0)
得点 200
コード長 479 Byte
結果 AC
実行時間 6 ms
メモリ 2124 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 6 ms 2052 KiB
02.txt AC 3 ms 1976 KiB
03.txt AC 1 ms 2000 KiB
11.txt AC 3 ms 1976 KiB
12.txt AC 2 ms 2080 KiB
13.txt AC 1 ms 2108 KiB
14.txt AC 2 ms 2100 KiB
15.txt AC 2 ms 1976 KiB
16.txt AC 2 ms 2124 KiB
17.txt AC 1 ms 2116 KiB