結果

問題 No.35 タイパー高橋
ユーザー m0ntBL4Ncm0ntBL4Nc
提出日時 2019-10-10 15:39:09
言語 Rust
(1.77.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 965 bytes
コンパイル時間 3,631 ms
コンパイル使用メモリ 151,336 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-13 16:11:18
合計ジャッジ時間 3,388 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

fn getline() -> String {
    let mut __ret = String::new();
    std::io::stdin().read_line(&mut __ret).ok();
    return __ret;
}

fn main() {
    let mut number_of_correct_type = 0;
    let mut number_of_miss_type = 0;

    let number_of_game: i32 = getline().trim().parse().unwrap();

    for _ in 0..number_of_game {
        let line = getline();
        let params: Vec<_> = line.trim().split(' ').collect();

        let time_limit: f64 = params[0].parse().unwrap();
        let word = params[1];
        let word_length = word.len();

        let can_type_max_word_length = (12.0 * time_limit / 1000.0) as usize;

        if can_type_max_word_length >= word_length {
            number_of_correct_type += word_length;
        } else {
            number_of_correct_type += can_type_max_word_length;
            number_of_miss_type += word_length - can_type_max_word_length;
        }
    }

    println!("{} {}", number_of_correct_type, number_of_miss_type);
}
0