結果

問題 No.3798 algo to goal
ユーザー atcoder8
提出日時 2026-11-13 23:15:23
言語 Rust
(1.99.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
WA  
実行時間 -
コード長 546 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,514 ms
コンパイル使用メモリ 178,048 KB
実行使用メモリ 8,780 KB
最終ジャッジ日時 2026-11-13 23:15:33
合計ジャッジ時間 8,755 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use itertools::Itertools;
use proconio::input;

fn main() {
    input! {
        q: usize,
    }

    let output = (0..q)
        .map(|_| if solve() { "Yes" } else { "No" })
        .join("\n");
    println!("{output}");
}

fn solve() -> bool {
    input! {
        s: String,
        t: String,
    }

    fn to_pair(s: &str) -> (String, String) {
        let s0 = s.chars().step_by(2).sorted_unstable().collect();
        let s1 = s[1..].chars().step_by(2).sorted_unstable().collect();
        (s0, s1)
    }

    to_pair(&s) == to_pair(&t)
}
0