結果

問題 No.2737 Compound Word
コンテスト
ユーザー Haniwa
提出日時 2025-10-06 20:18:11
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 2,000 ms
+ 180µs
コード長 371 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,206 ms
コンパイル使用メモリ 188,816 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-15 14:44:26
合計ジャッジ時間 3,023 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use proconio::input;
use std::collections::HashSet;

fn main() {
	input! {
		n: usize,
		s: [String; n],
	}

    let mut hash_set = HashSet::new();

    for i in 0..n {
        for j in 0..n {
            if i == j {
                continue;
            }

            hash_set.insert(format!("{}{}", s[i], s[j]));
        }
    }

    println!("{}", hash_set.len());
}
0