結果

問題 No.1113 二つの整数 / Two Integers
ユーザー 👑 KazunKazun
提出日時 2020-07-17 21:31:39
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,081 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 82,108 KB
実行使用メモリ 65,936 KB
最終ジャッジ日時 2024-05-07 07:08:56
合計ジャッジ時間 4,633 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
56,960 KB
testcase_01 AC 36 ms
51,968 KB
testcase_02 AC 150 ms
56,960 KB
testcase_03 AC 127 ms
57,216 KB
testcase_04 AC 126 ms
57,728 KB
testcase_05 TLE -
testcase_06 AC 37 ms
51,584 KB
testcase_07 AC 37 ms
52,480 KB
testcase_08 AC 36 ms
52,096 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#最大公約数
def gcd(m,n):
    x,y=max(m,n),min(m,n)
    if x%y==0:
        return y
    else:
        while x%y!=0:
            z=x%y
            x,y=y,z
        else:
            return z

#素因数分解
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

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