結果

問題 No.1113 二つの整数 / Two Integers
ユーザー NoneNone
提出日時 2021-03-13 20:45:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 1,000 ms
コード長 398 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 87,252 KB
実行使用メモリ 71,700 KB
最終ジャッジ日時 2023-08-05 13:48:23
合計ジャッジ時間 2,552 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,276 KB
testcase_01 AC 73 ms
71,416 KB
testcase_02 AC 77 ms
71,416 KB
testcase_03 AC 72 ms
71,468 KB
testcase_04 AC 73 ms
71,276 KB
testcase_05 AC 75 ms
71,288 KB
testcase_06 AC 73 ms
71,252 KB
testcase_07 AC 74 ms
71,440 KB
testcase_08 AC 76 ms
71,152 KB
testcase_09 AC 72 ms
71,700 KB
testcase_10 AC 77 ms
71,620 KB
testcase_11 AC 72 ms
71,296 KB
testcase_12 AC 77 ms
71,668 KB
testcase_13 AC 74 ms
71,416 KB
testcase_14 AC 74 ms
71,596 KB
testcase_15 AC 72 ms
71,340 KB
testcase_16 AC 71 ms
71,416 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def is_square2(N):
    """
    N = a**2 + r
    If r==0, N is squared number.
    """
    a,r = 0,0
    for s in reversed(range(0,N.bit_length(),2)):
        t = N>>s&3
        r = r<<2|t
        c = a<<2|1
        b = r>=c
        if b: r -= c
        a = a<<1|b
    return (a,r)


from math import gcd

A,B=map(int, input().split())
g=gcd(A,B)

a,r=is_square2(g)

print("Odd" if r==0 else "Even")
0