結果

問題 No.1113 二つの整数 / Two Integers
ユーザー 👑 KazunKazun
提出日時 2020-07-17 21:30:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,072 bytes
コンパイル時間 490 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 66,072 KB
最終ジャッジ日時 2024-05-07 07:03:54
合計ジャッジ時間 5,670 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
61,240 KB
testcase_01 WA -
testcase_02 AC 153 ms
57,756 KB
testcase_03 AC 131 ms
58,184 KB
testcase_04 AC 132 ms
59,020 KB
testcase_05 TLE -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 34 ms
53,272 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:
    print("Odd")
else:
    print("Even")
0