結果
問題 | No.1113 二つの整数 / Two Integers |
ユーザー | freecss00 |
提出日時 | 2020-07-17 21:49:33 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 485 bytes |
コンパイル時間 | 159 ms |
コンパイル使用メモリ | 82,248 KB |
実行使用メモリ | 59,844 KB |
最終ジャッジ日時 | 2024-05-07 08:03:51 |
合計ジャッジ時間 | 3,476 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 46 ms
59,136 KB |
testcase_01 | AC | 43 ms
53,760 KB |
testcase_02 | AC | 265 ms
58,624 KB |
testcase_03 | AC | 226 ms
59,264 KB |
testcase_04 | WA | - |
testcase_05 | TLE | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
ソースコード
import collections def get_primes(n): res = [] x = 2 while n >= x*x: while n % x == 0: n //= x res.append(x) x += 1 if n != 1: res.append(n) return res a, b = map(int, input().split()) ctr_a = collections.Counter(get_primes(a)) ctr_b = collections.Counter(get_primes(b)) res = 0 for x in ctr_b & ctr_a: res += (ctr_a[x] + 1) * (ctr_b[x] + 1) if res == 0 or res % 2 == 1: print('Odd') else: print('Even')