結果

問題 No.2153 何コーダーが何人?
ユーザー mo124121mo124121
提出日時 2022-11-25 06:18:03
言語 Rust
(1.77.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 661 bytes
コンパイル時間 1,905 ms
コンパイル使用メモリ 185,388 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 13:00:18
合計ジャッジ時間 2,583 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 1 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `i`
  --> main.rs:15:9
   |
15 |     for i in 0..N {
   |         ^ help: if this is intentional, prefix it with an underscore: `_i`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `key`
  --> main.rs:28:10
   |
28 |     for (key, value) in color.iter() {
   |          ^^^ help: if this is intentional, prefix it with an underscore: `_key`

warning: 2 warnings emitted

ソースコード

diff #

#![allow(clippy::let_unit_value)]
#![allow(non_snake_case)]
use std::{collections::HashMap, iter::zip};

use proconio::input;

fn main() {
    input! {
        N:usize,
    }
    let mut C = Vec::new();
    let mut S = Vec::new();

    let mut color: HashMap<String, usize> = HashMap::new();
    for i in 0..N {
        input! {
            s:String,
            c:usize
        }
        S.push(s);
        C.push(c);
    }
    for (s, c) in zip(S, C) {
        color.insert(s.to_string(), c);
    }

    let mut ans = vec![0_i32; 8];
    for (key, value) in color.iter() {
        ans[*value] += 1;
    }
    for a in ans {
        println!("{}", a);
    }
}
0