結果

問題 No.2017 Mod7 Parade
ユーザー vwxyzvwxyz
提出日時 2022-09-27 03:25:57
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 319 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 11,004 KB
実行使用メモリ 8,828 KB
最終ジャッジ日時 2023-08-24 03:28:58
合計ジャッジ時間 32,135 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,920 KB
testcase_01 AC 18 ms
7,828 KB
testcase_02 AC 16 ms
7,960 KB
testcase_03 AC 1,929 ms
8,676 KB
testcase_04 AC 1,108 ms
8,552 KB
testcase_05 AC 752 ms
8,404 KB
testcase_06 TLE -
testcase_07 AC 174 ms
8,528 KB
testcase_08 AC 1,015 ms
8,568 KB
testcase_09 AC 312 ms
8,512 KB
testcase_10 AC 1,033 ms
8,504 KB
testcase_11 AC 1,586 ms
8,716 KB
testcase_12 AC 1,336 ms
8,520 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 AC 1,910 ms
8,752 KB
testcase_20 AC 16 ms
7,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

dp=[0]*7
dp[0]=1
DL=[0,1,4,6,5,2]
mod=10**9+7
K=int(readline())
for k in range(K):
    d,l=map(int,readline().split())
    prev=dp
    dp=[x for x in dp]
    for i in range(7):
        dp[(i*pow(10,l,7)+d*DL[l%6])%7]+=prev[i]
ans=sum(i*dp[i]%mod for i in range(7))%mod
print(ans)
0