結果

問題 No.118 門松列(2)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-12-03 03:07:04
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 613 bytes
コンパイル時間 3,703 ms
コンパイル使用メモリ 71,628 KB
実行使用メモリ 60,596 KB
最終ジャッジ日時 2023-08-18 12:44:43
合計ジャッジ時間 13,279 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 476 ms
60,492 KB
testcase_02 AC 449 ms
60,416 KB
testcase_03 AC 484 ms
60,596 KB
testcase_04 AC 453 ms
60,076 KB
testcase_05 AC 451 ms
60,376 KB
testcase_06 AC 127 ms
55,516 KB
testcase_07 AC 128 ms
56,248 KB
testcase_08 AC 129 ms
56,004 KB
testcase_09 AC 441 ms
60,368 KB
testcase_10 AC 265 ms
60,296 KB
testcase_11 AC 297 ms
60,204 KB
testcase_12 AC 269 ms
60,244 KB
testcase_13 AC 228 ms
59,344 KB
testcase_14 AC 438 ms
59,984 KB
testcase_15 AC 192 ms
56,568 KB
testcase_16 AC 390 ms
60,264 KB
testcase_17 AC 223 ms
59,308 KB
testcase_18 AC 301 ms
60,496 KB
testcase_19 AC 374 ms
60,160 KB
testcase_20 AC 361 ms
59,764 KB
testcase_21 AC 451 ms
60,416 KB
testcase_22 AC 293 ms
60,380 KB
testcase_23 AC 427 ms
59,968 KB
testcase_24 AC 307 ms
60,472 KB
testcase_25 AC 365 ms
60,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int [] a = new int [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