結果
| 問題 |
No.1158 GCD Products easy
|
| ユーザー |
|
| 提出日時 | 2020-08-22 17:04:21 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,167 bytes |
| コンパイル時間 | 294 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,776 KB |
| 最終ジャッジ日時 | 2024-10-15 11:02:18 |
| 合計ジャッジ時間 | 2,240 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 25 |
ソースコード
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 = product(range(A, B + 1), 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):