結果
| 問題 |
No.2737 Compound Word
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-21 09:02:52 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 137 ms / 2,000 ms |
| コード長 | 578 bytes |
| コンパイル時間 | 2,265 ms |
| コンパイル使用メモリ | 77,860 KB |
| 実行使用メモリ | 41,916 KB |
| 最終ジャッジ日時 | 2024-10-13 07:55:08 |
| 合計ジャッジ時間 | 6,967 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int len=Integer.parseInt(sc.nextLine());
List<String> list=new ArrayList<>();
Set<String> made=new HashSet<>(len*len);
for(int i=0;i<len;i++){
list.add(sc.nextLine());
}
for(int i=0;i<len;i++){
for(int j=0;j<len;j++){
if(i==j) continue;
made.add(list.get(i)+list.get(j));
}
}
System.out.println(made.size());
}
}