結果

問題 No.118 門松列(2)
ユーザー convexineqconvexineq
提出日時 2020-12-17 21:15:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 5,000 ms
コード長 190 bytes
コンパイル時間 724 ms
コンパイル使用メモリ 81,672 KB
実行使用メモリ 83,140 KB
最終ジャッジ日時 2023-10-21 07:08:56
合計ジャッジ時間 2,726 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
61,816 KB
testcase_01 AC 69 ms
83,140 KB
testcase_02 AC 67 ms
80,980 KB
testcase_03 AC 68 ms
81,032 KB
testcase_04 AC 65 ms
81,076 KB
testcase_05 AC 68 ms
81,076 KB
testcase_06 AC 40 ms
53,516 KB
testcase_07 AC 40 ms
53,516 KB
testcase_08 AC 40 ms
53,516 KB
testcase_09 AC 62 ms
79,256 KB
testcase_10 AC 47 ms
62,836 KB
testcase_11 AC 49 ms
66,216 KB
testcase_12 AC 46 ms
61,804 KB
testcase_13 AC 45 ms
61,804 KB
testcase_14 AC 61 ms
79,204 KB
testcase_15 AC 44 ms
59,756 KB
testcase_16 AC 53 ms
70,264 KB
testcase_17 AC 47 ms
59,756 KB
testcase_18 AC 49 ms
66,220 KB
testcase_19 AC 51 ms
69,016 KB
testcase_20 AC 55 ms
69,872 KB
testcase_21 AC 62 ms
77,312 KB
testcase_22 AC 49 ms
63,208 KB
testcase_23 AC 58 ms
75,824 KB
testcase_24 AC 50 ms
66,788 KB
testcase_25 AC 54 ms
68,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
r = [0]*101
for ai in a: r[ai] += 1
MOD = 10**9+7
x,y,z,w = 1,0,0,0
for ri in r:
    y,z,w = (y+x*ri)%MOD, (z+y*ri)%MOD, (w+z*ri)%MOD
print(w)
0