結果

問題 No.1113 二つの整数 / Two Integers
ユーザー 👑 KazunKazun
提出日時 2020-07-17 21:33:00
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 907 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 81,984 KB
実行使用メモリ 60,428 KB
最終ジャッジ日時 2024-05-07 07:13:41
合計ジャッジ時間 4,826 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
60,428 KB
testcase_01 AC 37 ms
53,620 KB
testcase_02 AC 159 ms
58,096 KB
testcase_03 AC 136 ms
58,384 KB
testcase_04 AC 137 ms
58,200 KB
testcase_05 TLE -
testcase_06 AC 38 ms
52,592 KB
testcase_07 AC 38 ms
52,824 KB
testcase_08 AC 37 ms
52,444 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#素因数分解
def Prime_Factorization(N):
    if N<0:
        R=[[-1,1]]
    else:
        R=[]
        
    N=abs(N)
    k=2
    while k*k<=N:
        if N%k==0:
            C=0
            while N%k==0:
                C+=1
                N//=k
            R.append([k,C])
        k+=1
    
    if N!=1:
        R.append([N,1])
    if not R:
        R.append([N,1])

    return R

def Euler_Totient(N):
    N=abs(N)
    if N==1:
        return 1
    
    H=Prime_Factorization(N)
    R=1
    for (p,e) in H:
        R*=p**(e-1)*(p-1)
    return R

def Divisor_Sigma(N,K=1):
    H=Prime_Factorization(N)

    R=1
    if K==0:
        for (_,e) in H:
            R*=(e+1)
    else:
        for (p,e) in H:
            R*=(p**((e+1)*K)-1)//(p**K-1)
    return R

from math import gcd
A,B=map(int,input().split())
X=gcd(A,B)
S=Divisor_Sigma(X,0)

if S%2 or  X==1:
    print("Odd")
else:
    print("Even")
0