結果

問題 No.1113 二つの整数 / Two Integers
ユーザー O2MTO2MT
提出日時 2020-08-15 20:38:59
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 772 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 82,704 KB
実行使用メモリ 64,636 KB
最終ジャッジ日時 2024-04-19 06:48:12
合計ジャッジ時間 2,777 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,628 KB
testcase_01 AC 37 ms
52,224 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def gcd(x, y):
  x_list = []
  y_list = []
  
  cnt = 1
  while x > cnt :
    if x % cnt == 0:
      x_list.append(cnt)
    cnt += 1

  cnt = 1
  while y > cnt:
    if y % cnt == 0:
      y_list.append(cnt)
    cnt += 1

  cnt_x, cnt_y = 0, 0
  gcd_list = []
  for t_x in x_list:
    for  t_y in y_list:
      if t_x == t_y:
        gcd_list.append(t_y)

  return max(gcd_list)

def make_divisors(n):
  lower_divisors , upper_divisors = [], []
  i = 1
  while i*i <= n:
    if n % i == 0:
      lower_divisors.append(i)
      if i != n // i:
        upper_divisors.append(n//i)
    i += 1
  return lower_divisors + upper_divisors[::-1]

A,B = map(int,input().split())
g = gcd(A,B)
md = make_divisors(g)
count = len(md)
if count%2 == 0:
  print("Even")
else:
  print("Odd")
0