結果

問題 No.1158 GCD Products easy
ユーザー Ko Yuka
提出日時 2020-08-22 16:58:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 1,161 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-10-15 10:59:28
合計ジャッジ時間 2,038 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other RE * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect, bisect_left, bisect_right
from functools import reduce

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, N = MAP()

L = [n for n in range(A, B + 1)] #生成する数字
# num = 3 #生成するビット数
bit_list = list(product(L, repeat=N))
# print(bit_list)
ans = 1
for l in bit_list:
    # for y in l:
        # print(y)
    b = reduce(gcd, l)
    ans *= b % mod
    ans %= mod
print(ans)    



# for i in range(A, B+1):
#     b = reduce(gcd, i)

# for i in range(N):
0