結果

問題 No.1113 二つの整数 / Two Integers
ユーザー realDivineJKrealDivineJK
提出日時 2020-07-18 12:51:38
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 17 ms / 1,000 ms
コード長 569 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 10,968 KB
実行使用メモリ 7,992 KB
最終ジャッジ日時 2023-08-20 17:16:45
合計ジャッジ時間 1,271 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,828 KB
testcase_01 AC 16 ms
7,856 KB
testcase_02 AC 16 ms
7,856 KB
testcase_03 AC 16 ms
7,832 KB
testcase_04 AC 15 ms
7,812 KB
testcase_05 AC 15 ms
7,992 KB
testcase_06 AC 16 ms
7,904 KB
testcase_07 AC 16 ms
7,828 KB
testcase_08 AC 17 ms
7,828 KB
testcase_09 AC 16 ms
7,804 KB
testcase_10 AC 16 ms
7,828 KB
testcase_11 AC 16 ms
7,968 KB
testcase_12 AC 16 ms
7,904 KB
testcase_13 AC 15 ms
7,828 KB
testcase_14 AC 16 ms
7,964 KB
testcase_15 AC 16 ms
7,828 KB
testcase_16 AC 16 ms
7,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B = map(int, input().split())
def bit_digits(n):
    tmp = n
    cnt = 0
    while tmp:
        tmp >>= 1
        cnt += 1
    return cnt
def issquare(n: int):
    l, r = 0, n + 1
    d = (l + r) // 2
    cnt = bit_digits(n+1)
    for _ in range(cnt + 1):
        if d * d <= n:
            l = d
            d = (l + r) // 2
        else:
            r = d
            d = (l + r) // 2
    return d
def gcd(x, y):
    k, l = x, y
    while l:
        k, l = l, k % l
    return k
g = gcd(A, B)
d = issquare(g)
if d * d == g:
    print("Odd")
else:
    print("Even")
0