結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー mesame3993mesame3993
提出日時 2021-10-29 21:40:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 782 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 82,472 KB
実行使用メモリ 59,652 KB
最終ジャッジ日時 2024-04-16 14:24:16
合計ジャッジ時間 4,230 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
52,096 KB
testcase_01 AC 38 ms
52,608 KB
testcase_02 AC 37 ms
52,480 KB
testcase_03 AC 55 ms
57,728 KB
testcase_04 AC 62 ms
57,984 KB
testcase_05 AC 57 ms
57,856 KB
testcase_06 AC 60 ms
58,112 KB
testcase_07 AC 61 ms
58,112 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 63 ms
57,472 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 57 ms
57,856 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 60 ms
57,984 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 67 ms
57,896 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 AC 65 ms
57,728 KB
testcase_37 WA -
testcase_38 AC 38 ms
52,608 KB
testcase_39 AC 38 ms
52,608 KB
testcase_40 AC 53 ms
57,344 KB
testcase_41 WA -
testcase_42 AC 38 ms
52,736 KB
testcase_43 AC 38 ms
52,736 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 47 ms
58,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  x, a, y, b = map(int, input().split())
  def factorization(n):
    arr, I = [], []
    tmp = n 
    m = int(-(-n**0.5//1))+1
    for i in range(2, m):
      if tmp % i == 0:
        cnt = 0
        while tmp % i == 0:
          cnt += 1
          tmp //= i
        arr.append([i, cnt])
        I.append(i)
    if tmp != 1:
      arr.append([tmp, 1])
      I.append(tmp)
    if len(arr) == 0:
      arr.append([n, 1])
      I.append(n)
    return I, arr

  xi, X = factorization(x)
  yi, Y = factorization(y)
  xi = set(xi)

  for i in range(len(Y)):
    if yi[i] not in xi:
      print('No')
      exit()
    yy = Y[i][0]
    for j in range(len(X)):
      if yy == X[j][0]:
        if Y[i][1]*a > X[i][1]*b:
          print('No')
          exit()
  print('Yes')
main()
0