結果

問題 No.279 木の数え上げ
ユーザー seinyanseinyan
提出日時 2021-11-23 22:02:21
言語 Rust
(1.72.1)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 1,278 bytes
コンパイル時間 784 ms
コンパイル使用メモリ 138,836 KB
実行使用メモリ 7,668 KB
最終ジャッジ日時 2023-09-08 02:34:48
合計ジャッジ時間 2,397 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 9 ms
7,168 KB
testcase_11 AC 3 ms
4,376 KB
testcase_12 AC 6 ms
5,392 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 10 ms
7,668 KB
testcase_15 AC 8 ms
6,764 KB
testcase_16 AC 8 ms
6,164 KB
testcase_17 AC 9 ms
7,164 KB
testcase_18 AC 5 ms
4,576 KB
testcase_19 AC 9 ms
7,044 KB
testcase_20 AC 9 ms
7,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let s = input_line_vch();
    let mut count = vec![0, 0, 0];

    for ch in &s {
        match ch {
            't' => count[0] += 1,
            'r' => count[1] += 1,
            'e' => count[2] += 1,
            _ => (),
        }
    }
    count[2] /= 2;

    println!("{}", count.iter().min().unwrap());
}

#[allow(unused)]
fn input_a_value<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

#[allow(unused)]
fn input_line<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

#[allow(unused)]
fn input_matrix_num<T: std::str::FromStr>(n_lines: usize) -> Vec<Vec<T>> {
    (0..n_lines).map(|_| input_line()).collect()
}

#[allow(unused)]
fn input_line_string() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().to_string()
}

#[allow(unused)]
fn input_line_vch() -> Vec<char> {
    input_line_string().chars().collect()
}

#[allow(unused)]
fn input_matrix_ch(n_lines: usize) -> Vec<Vec<char>> {
    (0..n_lines).map(|_| input_line_vch()).collect()
}
0