結果

問題 No.118 門松列(2)
ユーザー 6soukiti296soukiti29
提出日時 2017-09-01 07:53:07
言語 Nim
(2.0.2)
結果
AC  
実行時間 21 ms / 5,000 ms
コード長 344 bytes
コンパイル時間 3,766 ms
コンパイル使用メモリ 69,592 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2023-09-12 15:03:52
合計ジャッジ時間 4,530 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
4,380 KB
testcase_01 AC 20 ms
11,008 KB
testcase_02 AC 20 ms
10,416 KB
testcase_03 AC 20 ms
10,412 KB
testcase_04 AC 21 ms
10,940 KB
testcase_05 AC 20 ms
10,928 KB
testcase_06 AC 4 ms
4,380 KB
testcase_07 AC 4 ms
4,384 KB
testcase_08 AC 5 ms
4,380 KB
testcase_09 AC 20 ms
10,272 KB
testcase_10 AC 7 ms
4,480 KB
testcase_11 AC 8 ms
4,896 KB
testcase_12 AC 6 ms
4,380 KB
testcase_13 AC 5 ms
4,380 KB
testcase_14 AC 19 ms
9,976 KB
testcase_15 AC 5 ms
4,380 KB
testcase_16 AC 12 ms
6,624 KB
testcase_17 AC 5 ms
4,384 KB
testcase_18 AC 8 ms
4,976 KB
testcase_19 AC 10 ms
6,304 KB
testcase_20 AC 11 ms
6,600 KB
testcase_21 AC 17 ms
9,720 KB
testcase_22 AC 7 ms
4,592 KB
testcase_23 AC 18 ms
9,812 KB
testcase_24 AC 9 ms
5,080 KB
testcase_25 AC 11 ms
6,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sequtils,strutils
var
    N = stdin.readline.parseInt
    A = stdin.readline.split.map(parseInt)
    cnt : array[1..100 , int64]
    m : int64 = 1_000_000_007
    ans : int64

for a in A:
    cnt[a] += 1
    
for i in 1..100:
    for j in 1..<i:
        for k in 1..<j:
            ans = (ans + (cnt[i] * cnt[j] * cnt[k])) mod m
echo ans
0