結果

問題 No.1177 余りは?
ユーザー uni_pythonuni_python
提出日時 2020-08-21 22:37:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 1,000 ms
コード長 946 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 82,276 KB
実行使用メモリ 134,944 KB
最終ジャッジ日時 2024-04-23 06:41:04
合計ジャッジ時間 4,126 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
89,348 KB
testcase_01 AC 142 ms
134,944 KB
testcase_02 AC 76 ms
79,400 KB
testcase_03 AC 116 ms
112,332 KB
testcase_04 AC 89 ms
88,732 KB
testcase_05 AC 90 ms
92,492 KB
testcase_06 AC 55 ms
69,404 KB
testcase_07 AC 56 ms
68,016 KB
testcase_08 AC 126 ms
119,988 KB
testcase_09 AC 124 ms
118,604 KB
testcase_10 AC 44 ms
60,572 KB
testcase_11 AC 101 ms
97,100 KB
testcase_12 AC 53 ms
67,472 KB
testcase_13 AC 62 ms
72,056 KB
testcase_14 AC 69 ms
78,892 KB
testcase_15 AC 82 ms
85,916 KB
testcase_16 AC 73 ms
79,272 KB
testcase_17 AC 133 ms
126,564 KB
testcase_18 AC 90 ms
92,640 KB
testcase_19 AC 108 ms
107,448 KB
testcase_20 AC 69 ms
72,288 KB
testcase_21 AC 98 ms
97,572 KB
testcase_22 AC 124 ms
119,672 KB
testcase_23 AC 91 ms
92,208 KB
testcase_24 AC 73 ms
80,124 KB
testcase_25 AC 115 ms
113,008 KB
testcase_26 AC 127 ms
118,984 KB
testcase_27 AC 63 ms
73,512 KB
testcase_28 AC 100 ms
96,952 KB
testcase_29 AC 92 ms
92,768 KB
testcase_30 AC 92 ms
92,520 KB
testcase_31 AC 108 ms
107,008 KB
testcase_32 AC 38 ms
52,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    p,k=MI()
    
    def calc_se():
        import itertools
        p=7
        for k in range(p):
            ans=0
            for ite in itertools.product([0,1,2,3,4,5,6,7,8,9], repeat=p-1):
                temp=0
                for i in range(p-1):
                    temp+=ite[i]*(i+1)
                if temp%p==k:
                    ans+=1
            print(ans)
        
        

    ans=[]
    tar=10
    
    for i in range(p-1):
        temp=tar//p
        rem=tar%p
        ans.append(temp)
        tar=rem*10
        
    ans2=0
    po=1
    for i in range(p-2,-1,-1):
        aaa=ans[i]*po
        ans2=(ans2+aaa)%mod
        po=(po*10)%mod
            
    if k==0:
        ans2=(ans2+1)%mod
    print(ans2)
        
        
    


main()
0