結果

問題 No.118 門松列(2)
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-12-03 03:11:01
言語 Java21
(openjdk 21)
結果
AC  
実行時間 431 ms / 5,000 ms
コード長 615 bytes
コンパイル時間 2,048 ms
コンパイル使用メモリ 71,604 KB
実行使用メモリ 62,120 KB
最終ジャッジ日時 2023-08-18 12:44:59
合計ジャッジ時間 11,117 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 193 ms
59,256 KB
testcase_01 AC 404 ms
60,252 KB
testcase_02 AC 386 ms
60,188 KB
testcase_03 AC 425 ms
60,060 KB
testcase_04 AC 412 ms
60,668 KB
testcase_05 AC 388 ms
60,572 KB
testcase_06 AC 119 ms
55,804 KB
testcase_07 AC 117 ms
55,836 KB
testcase_08 AC 114 ms
55,896 KB
testcase_09 AC 398 ms
60,208 KB
testcase_10 AC 251 ms
60,176 KB
testcase_11 AC 260 ms
62,120 KB
testcase_12 AC 220 ms
59,876 KB
testcase_13 AC 207 ms
60,100 KB
testcase_14 AC 382 ms
59,984 KB
testcase_15 AC 182 ms
58,628 KB
testcase_16 AC 353 ms
59,988 KB
testcase_17 AC 203 ms
59,420 KB
testcase_18 AC 303 ms
60,368 KB
testcase_19 AC 324 ms
60,240 KB
testcase_20 AC 346 ms
60,064 KB
testcase_21 AC 390 ms
59,760 KB
testcase_22 AC 313 ms
59,984 KB
testcase_23 AC 431 ms
60,188 KB
testcase_24 AC 291 ms
60,344 KB
testcase_25 AC 331 ms
60,380 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