結果
| 問題 |
No.2153 何コーダーが何人?
|
| コンテスト | |
| ユーザー |
mo124121
|
| 提出日時 | 2022-11-25 06:18:03 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 661 bytes |
| コンパイル時間 | 13,127 ms |
| コンパイル使用メモリ | 399,428 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-09 07:01:31 |
| 合計ジャッジ時間 | 14,177 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 19 |
コンパイルメッセージ
warning: unused variable: `i`
--> src/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`
--> src/main.rs:28:10
|
28 | for (key, value) in color.iter() {
| ^^^ help: if this is intentional, prefix it with an underscore: `_key`
ソースコード
#![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);
}
}
mo124121