結果
| 問題 |
No.279 木の数え上げ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-23 22:02:21 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 2,000 ms |
| コード長 | 1,278 bytes |
| コンパイル時間 | 13,056 ms |
| コンパイル使用メモリ | 378,304 KB |
| 実行使用メモリ | 7,692 KB |
| 最終ジャッジ日時 | 2024-06-25 19:42:56 |
| 合計ジャッジ時間 | 13,636 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 |
ソースコード
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()
}