結果

問題 No.1177 余りは?
ユーザー uni_pythonuni_python
提出日時 2020-08-21 22:37:48
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 173 ms / 1,000 ms
コード長 946 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 150,540 KB
最終ジャッジ日時 2023-08-05 09:01:21
合計ジャッジ時間 5,630 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
104,252 KB
testcase_01 AC 173 ms
150,540 KB
testcase_02 AC 105 ms
95,480 KB
testcase_03 AC 146 ms
127,932 KB
testcase_04 AC 117 ms
104,472 KB
testcase_05 AC 121 ms
108,420 KB
testcase_06 AC 87 ms
83,800 KB
testcase_07 AC 87 ms
83,660 KB
testcase_08 AC 155 ms
135,152 KB
testcase_09 AC 152 ms
134,556 KB
testcase_10 AC 78 ms
76,520 KB
testcase_11 AC 130 ms
112,144 KB
testcase_12 AC 85 ms
81,904 KB
testcase_13 AC 93 ms
87,928 KB
testcase_14 AC 102 ms
92,980 KB
testcase_15 AC 110 ms
101,080 KB
testcase_16 AC 101 ms
95,236 KB
testcase_17 AC 162 ms
142,216 KB
testcase_18 AC 120 ms
108,064 KB
testcase_19 AC 137 ms
121,748 KB
testcase_20 AC 91 ms
87,620 KB
testcase_21 AC 128 ms
112,348 KB
testcase_22 AC 153 ms
134,788 KB
testcase_23 AC 117 ms
107,856 KB
testcase_24 AC 102 ms
95,408 KB
testcase_25 AC 146 ms
127,928 KB
testcase_26 AC 155 ms
134,976 KB
testcase_27 AC 94 ms
87,668 KB
testcase_28 AC 127 ms
112,208 KB
testcase_29 AC 124 ms
108,276 KB
testcase_30 AC 122 ms
108,100 KB
testcase_31 AC 137 ms
121,864 KB
testcase_32 AC 68 ms
70,996 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