結果

問題 No.1177 余りは?
ユーザー beetbeet
提出日時 2020-08-21 22:15:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 305 ms / 1,000 ms
コード長 211 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 82,160 KB
実行使用メモリ 82,836 KB
最終ジャッジ日時 2024-04-23 06:39:22
合計ジャッジ時間 5,857 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
72,832 KB
testcase_01 AC 305 ms
82,836 KB
testcase_02 AC 100 ms
72,580 KB
testcase_03 AC 225 ms
78,332 KB
testcase_04 AC 117 ms
73,088 KB
testcase_05 AC 128 ms
74,100 KB
testcase_06 AC 56 ms
71,236 KB
testcase_07 AC 51 ms
68,096 KB
testcase_08 AC 260 ms
81,408 KB
testcase_09 AC 243 ms
79,708 KB
testcase_10 AC 36 ms
53,248 KB
testcase_11 AC 139 ms
74,624 KB
testcase_12 AC 48 ms
63,872 KB
testcase_13 AC 68 ms
71,760 KB
testcase_14 AC 74 ms
71,680 KB
testcase_15 AC 108 ms
72,704 KB
testcase_16 AC 94 ms
71,884 KB
testcase_17 AC 280 ms
82,012 KB
testcase_18 AC 127 ms
73,396 KB
testcase_19 AC 213 ms
77,664 KB
testcase_20 AC 67 ms
71,576 KB
testcase_21 AC 179 ms
75,516 KB
testcase_22 AC 247 ms
79,804 KB
testcase_23 AC 128 ms
73,456 KB
testcase_24 AC 95 ms
71,700 KB
testcase_25 AC 229 ms
78,384 KB
testcase_26 AC 260 ms
80,572 KB
testcase_27 AC 67 ms
71,276 KB
testcase_28 AC 135 ms
74,856 KB
testcase_29 AC 133 ms
73,856 KB
testcase_30 AC 129 ms
74,368 KB
testcase_31 AC 205 ms
77,424 KB
testcase_32 AC 34 ms
52,096 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