結果

問題 No.1158 GCD Products easy
ユーザー syunsukesyunsuke
提出日時 2020-09-18 01:30:05
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,112 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 71,580 KB
最終ジャッジ日時 2023-09-04 08:14:22
合計ジャッジ時間 3,606 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,180 KB
testcase_01 AC 75 ms
71,512 KB
testcase_02 WA -
testcase_03 AC 75 ms
71,184 KB
testcase_04 AC 75 ms
71,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 74 ms
71,556 KB
testcase_09 AC 76 ms
71,384 KB
testcase_10 AC 76 ms
71,460 KB
testcase_11 AC 75 ms
71,024 KB
testcase_12 WA -
testcase_13 AC 75 ms
71,316 KB
testcase_14 AC 76 ms
71,440 KB
testcase_15 AC 74 ms
71,176 KB
testcase_16 AC 76 ms
71,024 KB
testcase_17 AC 75 ms
71,428 KB
testcase_18 AC 76 ms
71,340 KB
testcase_19 AC 75 ms
71,176 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 74 ms
71,380 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 74 ms
71,272 KB
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,N=map(int,input().split())
L=[0 for i in range(11)]

for i in range(B,A-1,-1):
    #print(i)
    if i*2>B:
        L[i]=1
    elif i==5:
        if B>=i*2:
            L[i]+=(2**N)-L[i*2]
        else:
            L[i]+=1
    elif i==4:
        if B>=i*2:
            L[i]+=(2**N)-L[i*2]
        else:
            L[i]+=1
        
    elif i==3:
        if B>=3*i:
            L[i]+=(3**N)-L[i*3]-L[i*2]
        elif B>=2*i:
            L[i]+=(2**N)-L[i*2]
        else:
            L[i]+=1
    elif i==2:
        if B>=5*i:
            L[i]+=(5**N)-L[i*5]-L[i*3]-(2**N)
        elif B>=4*i:
            L[i]+=(4**N)-L[i*3]-(2**N)
        elif B>=3*i:
            L[i]+=(3**N)-L[i*3]-L[i*2]
        elif B>=2*i:
            L[i]+=(2**N)-L[i*2]
        else:
            L[i]+=1
if B>=6 and 4>=A:
            L[2]+=(2**N)-2
if B>=8 and 6>=A:
            L[2]+=(2**N)-2
if B>=10 and 6>=A:
            L[2]+=(2**N)-2
if B>=10 and 8>=A:
            L[2]+=(2**N)-2
if B>=10 and 4>=A:
            L[2]+=(2**N)-2
mod=10**9+7

ans=1
for i in range(1,11):
    ans=ans*pow(i,L[i],mod)
    ans%=mod
print(ans)
#print(L)
0