結果

問題 No.2737 Compound Word
ユーザー t33f
提出日時 2024-04-21 10:51:54
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 450 bytes
コンパイル時間 11,873 ms
コンパイル使用メモリ 393,608 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 09:40:11
合計ジャッジ時間 13,102 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#![allow(non_snake_case)]
use std::collections::HashSet;
use proconio::{input, marker::Bytes};

fn main() {
    input! { n: usize, s: [Bytes; n] }
    let mut strs = HashSet::new();
    for i in 0..n {
        for j in 0..n {
            if i != j {
                let mut t = s[i].clone();
                t.append(&mut s[j].clone());
                strs.insert(t);
            }
        }
    }
    let ans = strs.len();
    println!("{ans}");
}
0