結果
問題 | No.2737 Compound Word |
ユーザー |
|
提出日時 | 2024-05-13 19:00:01 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 376 bytes |
コンパイル時間 | 12,907 ms |
コンパイル使用メモリ | 401,488 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-20 09:36:11 |
合計ジャッジ時間 | 14,212 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 27 |
ソースコード
use std::{collections::HashSet, io::Read};fn main() {let mut s = String::new();std::io::stdin().read_to_string(&mut s).ok();let mut h = HashSet::new();let s: Vec<_> = s.split_whitespace().skip(1).collect();for i in 0..s.len() {for j in i + 1..s.len() {h.insert(s[i].to_owned() + s[j]);h.insert(s[j].to_owned() + s[i]);}}println!("{}", h.len())}