結果

問題 No.69 文字を自由に並び替え
コンテスト
ユーザー Maricom_tkg
提出日時 2018-10-24 18:43:31
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 13 ms / 5,000 ms
コード長 508 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,148 ms
コンパイル使用メモリ 198,724 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-05-25 01:12:02
合計ジャッジ時間 3,078 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    
    let mut iter = buf.split_whitespace();
    
    let mut a: Vec<char> = iter.next().unwrap().chars().collect();
    let mut b: Vec<char> = iter.next().unwrap().chars().collect();
    
    a.sort();
    b.sort();
    
    let mut result = "YES";
    
    for i in 0..a.len() {
        if a[i] != b[i] {
            result = "NO";
        }
    }
    
    println!("{}", result);
}
0