結果

問題 No.1224 I hate Sqrt Inequality
コンテスト
ユーザー ssmkzk
提出日時 2020-11-17 14:22:34
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 532 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 55 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2026-10-12 05:45:43
合計ジャッジ時間 8,074 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            if i % 2 != 0 and i != 5:
                factors.append(i)
    if n > 1:
        if n % 2 != 0 and i != 5:
            factors.append(n)
    return factors

a, b = map(int, input().split())




l = prime_factors(a)
ll = prime_factors(b)


f = 0
for li in ll:
    try:
        l.remove(li)
    except:
        print("Yes")
        f = 1
        break

if f == 0:
    print("No")
0