結果
| 問題 | No.2707 Bag of Words Encryption |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-31 13:35:16 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 534 bytes |
| 記録 | |
| コンパイル時間 | 1,398 ms |
| コンパイル使用メモリ | 190,264 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-16 20:10:04 |
| 合計ジャッジ時間 | 2,397 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 |
ソースコード
use std::collections::HashMap;
fn main() {
let stdin = std::io::stdin();
let mut line = String::new();
stdin.read_line(&mut line).unwrap();
let mut line = String::new();
stdin.read_line(&mut line).unwrap();
let line = line.trim();
let mut counter = HashMap::new();
for c in line.chars() {
*counter.entry(c).or_insert(0) += 1;
}
let mut ret = String::new();
for c in 'A'..='Z' {
ret += &format!("{}", counter.get(&c).cloned().unwrap_or(0));
}
println!("{}", ret);
}