結果
問題 | No.69 文字を自由に並び替え |
ユーザー |
|
提出日時 | 2020-10-24 11:10:23 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 798 bytes |
コンパイル時間 | 15,145 ms |
コンパイル使用メモリ | 403,656 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-21 15:03:31 |
合計ジャッジ時間 | 13,793 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
use std::collections::HashMap;use std::io::{self, BufReader, BufWriter, Read, Write};fn main() {let stdin = io::stdin();let mut stdin = BufReader::new(stdin.lock());let stdout = io::stdout();let mut stdout = BufWriter::new(stdout.lock());let mut buf = String::new();stdin.read_to_string(&mut buf).unwrap();let mut iter = buf.split_whitespace();let mut a = HashMap::new();for c in iter.next().unwrap().chars() {let entry = a.entry(c).or_insert(0);*entry += 1;}let mut b = HashMap::new();for c in iter.next().unwrap().chars() {let entry = b.entry(c).or_insert(0);*entry += 1;}if a == b {stdout.write(b"YES").unwrap();} else {stdout.write(b"NO").unwrap();}}