結果

問題 No.2737 Compound Word
ユーザー koufu193koufu193
提出日時 2024-04-21 09:02:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 578 bytes
コンパイル時間 2,313 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 41,960 KB
最終ジャッジ日時 2024-04-21 09:03:00
合計ジャッジ時間 7,075 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 98 ms
39,808 KB
testcase_01 AC 133 ms
41,440 KB
testcase_02 AC 115 ms
40,936 KB
testcase_03 AC 101 ms
39,884 KB
testcase_04 AC 114 ms
41,208 KB
testcase_05 AC 115 ms
41,164 KB
testcase_06 AC 115 ms
40,900 KB
testcase_07 AC 121 ms
41,380 KB
testcase_08 AC 126 ms
41,636 KB
testcase_09 AC 131 ms
41,924 KB
testcase_10 AC 125 ms
41,624 KB
testcase_11 AC 110 ms
40,388 KB
testcase_12 AC 134 ms
41,236 KB
testcase_13 AC 103 ms
40,240 KB
testcase_14 AC 114 ms
41,140 KB
testcase_15 AC 99 ms
39,620 KB
testcase_16 AC 122 ms
41,332 KB
testcase_17 AC 126 ms
41,252 KB
testcase_18 AC 129 ms
41,524 KB
testcase_19 AC 124 ms
40,744 KB
testcase_20 AC 121 ms
41,420 KB
testcase_21 AC 120 ms
41,188 KB
testcase_22 AC 126 ms
41,716 KB
testcase_23 AC 113 ms
40,436 KB
testcase_24 AC 124 ms
41,396 KB
testcase_25 AC 112 ms
40,152 KB
testcase_26 AC 125 ms
41,960 KB
testcase_27 AC 138 ms
40,176 KB
testcase_28 AC 115 ms
41,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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());
    }
}
0