結果

問題 No.118 門松列(2)
ユーザー threepipes_sthreepipes_s
提出日時 2016-01-03 19:54:59
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 64 ms / 5,000 ms
コード長 198 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 16,976 KB
最終ジャッジ日時 2024-04-17 13:30:35
合計ジャッジ時間 2,168 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 64 ms
16,976 KB
testcase_02 AC 61 ms
16,476 KB
testcase_03 AC 61 ms
16,440 KB
testcase_04 AC 63 ms
16,636 KB
testcase_05 AC 63 ms
16,624 KB
testcase_06 AC 29 ms
10,624 KB
testcase_07 AC 29 ms
10,624 KB
testcase_08 AC 30 ms
10,624 KB
testcase_09 AC 63 ms
16,312 KB
testcase_10 AC 35 ms
11,904 KB
testcase_11 AC 38 ms
12,160 KB
testcase_12 AC 34 ms
11,520 KB
testcase_13 AC 32 ms
11,136 KB
testcase_14 AC 60 ms
16,096 KB
testcase_15 AC 30 ms
10,752 KB
testcase_16 AC 46 ms
13,952 KB
testcase_17 AC 32 ms
11,264 KB
testcase_18 AC 38 ms
12,288 KB
testcase_19 AC 44 ms
13,308 KB
testcase_20 AC 45 ms
13,568 KB
testcase_21 AC 54 ms
15,312 KB
testcase_22 AC 36 ms
12,032 KB
testcase_23 AC 52 ms
15,208 KB
testcase_24 AC 39 ms
12,544 KB
testcase_25 AC 43 ms
13,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
input()
dp = [0]*3
for d in dict(Counter(list(map(int, input().split())))).values():
    dp[2] += dp[1]*d
    dp[1] += dp[0]*d
    dp[0] += d
print(dp[2]%1000000007)
0