結果

問題 No.118 門松列(2)
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-07 09:07:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 587 ms / 5,000 ms
コード長 635 bytes
コンパイル時間 2,369 ms
コンパイル使用メモリ 74,260 KB
実行使用メモリ 48,124 KB
最終ジャッジ日時 2024-04-17 12:55:54
合計ジャッジ時間 13,127 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 228 ms
46,048 KB
testcase_01 AC 522 ms
48,052 KB
testcase_02 AC 496 ms
47,884 KB
testcase_03 AC 587 ms
48,120 KB
testcase_04 AC 551 ms
47,820 KB
testcase_05 AC 499 ms
47,932 KB
testcase_06 AC 121 ms
40,076 KB
testcase_07 AC 137 ms
41,300 KB
testcase_08 AC 123 ms
40,232 KB
testcase_09 AC 539 ms
47,848 KB
testcase_10 AC 287 ms
47,340 KB
testcase_11 AC 337 ms
47,432 KB
testcase_12 AC 259 ms
46,820 KB
testcase_13 AC 232 ms
46,216 KB
testcase_14 AC 517 ms
48,124 KB
testcase_15 AC 192 ms
43,716 KB
testcase_16 AC 353 ms
46,516 KB
testcase_17 AC 225 ms
45,776 KB
testcase_18 AC 321 ms
47,660 KB
testcase_19 AC 438 ms
47,760 KB
testcase_20 AC 426 ms
47,960 KB
testcase_21 AC 513 ms
47,704 KB
testcase_22 AC 299 ms
46,724 KB
testcase_23 AC 488 ms
47,616 KB
testcase_24 AC 349 ms
47,852 KB
testcase_25 AC 434 ms
48,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
       int n = koko.nextInt();
       long[] b = new long[100];
       for(int i=0; i<n; i++){
           int length = koko.nextInt();
           b[length-1]++;
       }
       long kado =0;
       for(int i=0; i<100; i++){
           for(int j=i+1; j<100; j++){
               for(int k=j+1; k<100; k++){
                   long c =b[i]*b[j]*b[k];
                   kado = (kado + c)%1000000007;
               }
           }
       }
       System.out.println(kado);
       
    }
}
0