結果

問題 No.69 文字を自由に並び替え
コンテスト
ユーザー mtwtkman
提出日時 2019-10-15 22:35:15
言語 Rust
(1.99.0 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 5,000 ms
+ 841µs
コード長 542 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 932 ms
コンパイル使用メモリ 194,260 KB
実行使用メモリ 9,848 KB
最終ジャッジ日時 2026-10-09 17:48:03
合計ジャッジ時間 3,115 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::{self, Read};

fn read_stdin() -> Vec<String> {
    let mut buffer = String::new();
    io::stdin().read_to_string(&mut buffer).ok();
    buffer.trim().split('\n').map(|s| s.to_string()).collect()
}

fn main() {
    let input = read_stdin();
    let bytes = input
        .iter()
        .map(|s| {
            let mut x = s.as_bytes().to_vec();
            x.sort();
            String::from_utf8(x).unwrap()
        })
        .collect::<Vec<String>>();
    println!("{}", if &bytes[0] == &bytes[1] { "YES" } else { "NO" });
}
0