結果

問題 No.1113 二つの整数 / Two Integers
コンテスト
ユーザー marroncastle
提出日時 2020-07-17 21:25:23
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
実行時間 -
コード長 504 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 759 ms
コンパイル使用メモリ 20,824 KB
実行使用メモリ 23,552 KB
最終ジャッジ日時 2026-05-23 13:54:15
合計ジャッジ時間 6,274 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 3 TLE * 1 -- * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from math import gcd
from collections import Counter
#素因数分解して列挙する関数、約数列挙ではない!
def factorize(n):
  ans = 1
  b = 2
  fct = []
  while b * b <= n:
    while n % b == 0:
      n //= b
      fct.append(b)
    b = b + 1
  if n > 1:
    fct.append(n)
  c = Counter(fct)
  for v in c.values():
    ans *= v+1
  return ans

def check():
  A, B = map(int, input().split())
  g = gcd(A,B)
  a = factorize(g)
  if a%2==0:
    return 'Even'
  return 'Odd'
print(check())
0