結果
| 問題 |
No.1723 [Cherry 3rd Tune *] Dead on
|
| コンテスト | |
| ユーザー |
mkawa2
|
| 提出日時 | 2021-10-29 21:30:05 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 217 ms / 2,000 ms |
| コード長 | 1,483 bytes |
| コンパイル時間 | 199 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-10-07 10:02:59 |
| 合計ジャッジ時間 | 4,353 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 50 |
ソースコード
import sys
# sys.setrecursionlimit(200005)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
dij = [(0, 1), (1, 0), (0, -1), (-1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = 1 << 63
# md = 998244353
md = 10**9+7
# (底,指数)を返す
# 18=2**1 * 3**2なので[(2,1),(3,2)]
def PrimeFactorization(x):
def plist(x):
if x < 2: return []
if x & 1 == 0: return [2]+plist(x >> 1)
for p in range(3, x+1, 2):
if x%p == 0: return [p]+plist(x//p)
if p**2 > x: return [x]
pl = plist(x)
pp, ee = [], []
for p in pl:
if not pp or p != pp[-1]:
pp += [p]
ee += [0]
ee[-1] += 1
return pp, ee
from collections import Counter
x, a, y, b = LI()
def cntp(a):
ca = Counter()
pp, ee = PrimeFactorization(a)
for p, e in zip(pp, ee):
ca[p] = e
return ca
def solve():
cx = cntp(x)
cy = cntp(y)
for p, e in cy.items():
if e*b > cx[p]*a: return False
return True
print("Yes" if solve() else "No")
mkawa2