結果

問題 No.35 タイパー高橋
コンテスト
ユーザー Tiramister
提出日時 2018-09-01 18:31:42
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 875 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 11,249 ms
コンパイル使用メモリ 196,904 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-04-08 03:16:58
合計ジャッジ時間 6,462 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::*;
use std::str::FromStr;

use std::cmp;

#[allow(dead_code)]
fn get_line() -> String {
    let stdin = stdin();
    let mut line = String::new();
    stdin.lock().read_line(&mut line).expect("io error.");
    line.trim().to_string()
}

#[allow(dead_code)]
fn get_word<T: FromStr>() -> T {
    (&get_line()).parse().ok().expect("parse error.")
}

#[allow(dead_code)]
fn get_vec<T: FromStr>() -> Vec<T> {
    (&get_line()).split(' ').map(|x| x.parse().ok().expect("parse error.")).collect()
}

fn main() {
    let n = get_word::<u64>();

    let mut good: u64 = 0;
    let mut total: u64 = 0;

    for _ in 0..n {
        let s = get_vec::<String>();
        let t: u64 = (&s[0]).parse().ok().unwrap();
        let l: u64 = (&s[1]).len() as u64;

        total += l;
        good += cmp::min(t * 12 / 1000, l);
    }

    println!("{} {}", good, total - good);
}
0