結果

問題 No.1317 月曜日の朝、WAを出した
ユーザー tonyu0tonyu0
提出日時 2020-12-14 01:18:24
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 1,044 bytes
コンパイル時間 1,266 ms
コンパイル使用メモリ 183,100 KB
実行使用メモリ 5,028 KB
最終ジャッジ日時 2023-10-20 04:36:48
合計ジャッジ時間 1,798 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::collections::HashMap;
use std::io::*;

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let mut mp: HashMap<&str, usize> = HashMap::new();
    mp.insert("AC", 0);
    mp.insert("WA", 1);
    mp.insert("TLE", 2);
    mp.insert("MLE", 3);
    mp.insert("OLE", 4);
    mp.insert("RE", 5);

    for _ in 0..n {
        let mut a: Vec<usize> = (0..6)
            .map(|_| itr.next().unwrap().parse().unwrap())
            .collect();
        let b: Vec<usize> = (0..6)
            .map(|_| itr.next().unwrap().parse().unwrap())
            .collect();
        let s: &str = itr.next().unwrap();
        let i = mp[s];
        for j in 1..6 {
            if i == j {
                continue;
            }
            a[i] += a[j];
            a[j] = 0;
        }
        if a[i] <= b[i] {
            println!("Yes")
        } else {
            println!("No")
        }
    }
}
0