結果

問題 No.1164 GCD Products hard
ユーザー mkawa2mkawa2
提出日時 2021-06-16 22:38:50
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 1,056 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 86,632 KB
実行使用メモリ 187,076 KB
最終ジャッジ日時 2023-08-30 04:08:03
合計ジャッジ時間 32,345 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 705 ms
186,868 KB
testcase_23 AC 1,031 ms
186,856 KB
testcase_24 WA -
testcase_25 AC 704 ms
186,632 KB
testcase_26 WA -
testcase_27 AC 676 ms
186,648 KB
testcase_28 AC 685 ms
186,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = 10**16
# md = 998244353
md = 10**9+7

mx = 10000001
isprime = [True]*mx
pp = []
for a in range(2, mx):
    if isprime[a]:
        pp.append(a)
        for b in range(a*a, mx, a):
            isprime[b] = False

a, b, n = LI()
ans = 1
for p in pp:
    cnt = 0
    s = p
    while s <= b:
        cnt += pow(b//s-(a-1)//s, n, md)
        s *= p
    ans = ans*pow(p, cnt, md)%md
print(ans)
0