結果
| 問題 |
No.35 タイパー高橋
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-10 15:39:09 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 965 bytes |
| コンパイル時間 | 14,113 ms |
| コンパイル使用メモリ | 378,564 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 12:12:26 |
| 合計ジャッジ時間 | 13,493 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 |
ソースコード
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);
}