結果

問題 No.2017 Mod7 Parade
ユーザー googol_S0googol_S0
提出日時 2022-07-22 21:27:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 222 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 819 ms
コンパイル使用メモリ 87,336 KB
実行使用メモリ 77,636 KB
最終ジャッジ日時 2023-09-17 08:50:00
合計ジャッジ時間 5,786 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,296 KB
testcase_01 AC 71 ms
71,248 KB
testcase_02 AC 71 ms
71,328 KB
testcase_03 AC 195 ms
77,320 KB
testcase_04 AC 159 ms
77,260 KB
testcase_05 AC 141 ms
77,284 KB
testcase_06 AC 206 ms
77,580 KB
testcase_07 AC 103 ms
77,096 KB
testcase_08 AC 155 ms
77,636 KB
testcase_09 AC 113 ms
77,088 KB
testcase_10 AC 156 ms
77,016 KB
testcase_11 AC 180 ms
77,612 KB
testcase_12 AC 169 ms
77,160 KB
testcase_13 AC 221 ms
77,112 KB
testcase_14 AC 222 ms
77,576 KB
testcase_15 AC 221 ms
77,036 KB
testcase_16 AC 222 ms
77,284 KB
testcase_17 AC 222 ms
77,128 KB
testcase_18 AC 213 ms
77,308 KB
testcase_19 AC 145 ms
77,288 KB
testcase_20 AC 70 ms
71,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=10**9+7
X=[0]*7
X[0]=1
for t in range(int(input())):
  d,l=map(int,input().split())
  a=pow(10,l,7)
  b=((a-1)*d%7)*pow(9,5,7)%7
  Y=X[:]
  for i in range(7):
    Y[(a*i+b)%7]=(Y[(a*i+b)%7]+X[i])%mod
  X=Y[:]
print(sum([i*X[i] for i in range(7)])%mod)
0