結果

問題 No.1177 余りは?
ユーザー beetbeet
提出日時 2020-08-21 22:15:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 719 ms / 1,000 ms
コード長 211 bytes
コンパイル時間 422 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 85,068 KB
最終ジャッジ日時 2023-08-05 08:59:22
合計ジャッジ時間 10,523 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 154 ms
73,300 KB
testcase_01 AC 400 ms
85,068 KB
testcase_02 AC 160 ms
72,236 KB
testcase_03 AC 625 ms
76,296 KB
testcase_04 AC 257 ms
73,348 KB
testcase_05 AC 173 ms
75,332 KB
testcase_06 AC 86 ms
71,996 KB
testcase_07 AC 87 ms
71,308 KB
testcase_08 AC 438 ms
80,144 KB
testcase_09 AC 719 ms
77,028 KB
testcase_10 AC 75 ms
71,384 KB
testcase_11 AC 185 ms
74,924 KB
testcase_12 AC 82 ms
71,144 KB
testcase_13 AC 125 ms
71,804 KB
testcase_14 AC 111 ms
72,496 KB
testcase_15 AC 220 ms
72,416 KB
testcase_16 AC 132 ms
72,428 KB
testcase_17 AC 492 ms
80,868 KB
testcase_18 AC 186 ms
74,044 KB
testcase_19 AC 391 ms
76,724 KB
testcase_20 AC 121 ms
71,936 KB
testcase_21 AC 239 ms
76,396 KB
testcase_22 AC 362 ms
80,620 KB
testcase_23 AC 198 ms
74,000 KB
testcase_24 AC 141 ms
73,000 KB
testcase_25 AC 636 ms
76,968 KB
testcase_26 AC 394 ms
81,064 KB
testcase_27 AC 120 ms
72,172 KB
testcase_28 AC 181 ms
74,516 KB
testcase_29 AC 178 ms
75,200 KB
testcase_30 AC 174 ms
75,264 KB
testcase_31 AC 389 ms
76,836 KB
testcase_32 AC 75 ms
71,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

p, k = map(int, input().split())

res = 1

n = p - 1
t = 10
while n != 0:
    if n % 2 == 1: res *= t
    t *= t
    n //= 2

ans = res // p
if k < pow(10, p - 1, p): ans += 1

MOD = int(1e9+7)
print(ans % MOD)
0