結果

問題 No.118 門松列(2)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-12-03 03:11:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 524 ms / 5,000 ms
コード長 615 bytes
コンパイル時間 2,481 ms
コンパイル使用メモリ 77,332 KB
実行使用メモリ 48,184 KB
最終ジャッジ日時 2024-11-27 17:51:02
合計ジャッジ時間 11,471 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 204 ms
45,936 KB
testcase_01 AC 485 ms
47,784 KB
testcase_02 AC 507 ms
47,804 KB
testcase_03 AC 422 ms
46,620 KB
testcase_04 AC 474 ms
48,184 KB
testcase_05 AC 524 ms
47,800 KB
testcase_06 AC 139 ms
40,280 KB
testcase_07 AC 143 ms
40,740 KB
testcase_08 AC 130 ms
41,184 KB
testcase_09 AC 403 ms
46,704 KB
testcase_10 AC 269 ms
47,224 KB
testcase_11 AC 312 ms
47,604 KB
testcase_12 AC 241 ms
46,956 KB
testcase_13 AC 224 ms
46,016 KB
testcase_14 AC 462 ms
47,768 KB
testcase_15 AC 178 ms
43,396 KB
testcase_16 AC 436 ms
47,788 KB
testcase_17 AC 225 ms
45,940 KB
testcase_18 AC 299 ms
47,988 KB
testcase_19 AC 322 ms
46,316 KB
testcase_20 AC 387 ms
48,140 KB
testcase_21 AC 374 ms
46,552 KB
testcase_22 AC 299 ms
47,524 KB
testcase_23 AC 453 ms
48,032 KB
testcase_24 AC 313 ms
47,768 KB
testcase_25 AC 324 ms
46,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long [] a = new long [100];
        for(int i=0; i<N; i++){
            int t=sc.nextInt();
            a[t-1]++;
        }
        long total=0;
        for(int i=0; i<100; i++){
            for(int j=i+1; j<100; j++){
                for(int k=j+1; k<100; k++){
                    total+=a[i]*a[j]*a[k];
                }
            }
        }
        int m=(int)Math.pow(10,9)+7;
        total%=m;
        System.out.println(total);
    }
}
0