結果
| 問題 |
No.1113 二つの整数 / Two Integers
|
| コンテスト | |
| ユーザー |
ryo_n
|
| 提出日時 | 2020-07-17 21:37:50 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,120 bytes |
| コンパイル時間 | 244 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 118,144 KB |
| 最終ジャッジ日時 | 2024-11-29 22:20:56 |
| 合計ジャッジ時間 | 16,304 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 TLE * 7 |
ソースコード
import sys
import collections
sys.setrecursionlimit(10 ** 8)
input = sys.stdin.readline
def main():
A, B = [int(x) for x in input().split()]
def prime_factorization(n):
i = 2
factors = []
while i * i <= n:
if n % i:
i += 1
else:
n //= i
factors.append(i)
if n > 1:
factors.append(n)
return factors
aprimes = prime_factorization(A)
bprimes = prime_factorization(B)
x = []
for a in aprimes:
if a in bprimes:
x.append(a)
bprimes.remove(a)
xx = 1
for xxx in x:
xx *= xxx
def make_divisors(n):
divisors = []
for i in range(1, int(n ** 0.5) + 1):
if n % i == 0:
divisors.append(i)
if i != n // i:
divisors.append(n // i)
# divisors.sort()
return divisors
xxxx = make_divisors(xx)
if len(xxxx) % 2 == 0:
print("Even")
else:
print("Odd")
if __name__ == '__main__':
main()
ryo_n