結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー mmn15277198mmn15277198
提出日時 2021-10-30 08:14:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 925 ms / 2,000 ms
コード長 917 bytes
コンパイル時間 954 ms
コンパイル使用メモリ 99,536 KB
実行使用メモリ 128,512 KB
最終ジャッジ日時 2024-04-16 16:12:09
合計ジャッジ時間 8,113 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 13 ms
6,016 KB
testcase_04 AC 327 ms
61,056 KB
testcase_05 AC 82 ms
19,200 KB
testcase_06 AC 22 ms
7,936 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 83 ms
17,280 KB
testcase_09 AC 7 ms
5,376 KB
testcase_10 AC 110 ms
21,632 KB
testcase_11 AC 4 ms
5,376 KB
testcase_12 AC 21 ms
7,168 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 7 ms
5,376 KB
testcase_15 AC 599 ms
89,216 KB
testcase_16 AC 130 ms
24,704 KB
testcase_17 AC 667 ms
96,512 KB
testcase_18 AC 279 ms
45,568 KB
testcase_19 AC 165 ms
29,568 KB
testcase_20 AC 67 ms
14,720 KB
testcase_21 AC 306 ms
49,408 KB
testcase_22 AC 88 ms
17,920 KB
testcase_23 AC 131 ms
24,448 KB
testcase_24 AC 6 ms
5,376 KB
testcase_25 AC 304 ms
49,408 KB
testcase_26 AC 63 ms
14,080 KB
testcase_27 AC 3 ms
5,376 KB
testcase_28 AC 365 ms
56,832 KB
testcase_29 AC 253 ms
42,880 KB
testcase_30 AC 591 ms
85,632 KB
testcase_31 AC 245 ms
41,088 KB
testcase_32 AC 57 ms
13,056 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 2 ms
5,376 KB
testcase_35 AC 2 ms
5,376 KB
testcase_36 AC 925 ms
128,512 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 2 ms
5,376 KB
testcase_39 AC 2 ms
5,376 KB
testcase_40 AC 2 ms
5,376 KB
testcase_41 AC 2 ms
5,376 KB
testcase_42 AC 2 ms
5,376 KB
testcase_43 AC 2 ms
5,376 KB
testcase_44 AC 2 ms
5,376 KB
testcase_45 AC 2 ms
5,376 KB
testcase_46 AC 2 ms
5,376 KB
testcase_47 AC 2 ms
5,376 KB
testcase_48 AC 2 ms
5,376 KB
testcase_49 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <set>
#include <cstdio>

using namespace std;

int main() {
  //SSRSさんの写し
  long long x , a , y , b;
  cin >> x >> a >> y >> b;
  map<long long , long long> mp1;
  for (long long i = 2; i * i <= x; i++) {
    long long cnt = 0;
    while (x % i == 0) {
      cnt++;
      x /= i;
    }
    mp1[i] = cnt * a;
  }
  if (x > 1) {
    mp1[x] = a;
  }

  map<long long , long long> mp2;
  for (long long i = 2; i * i <= y; i++) {
    long long cnt = 0;
    while (y % i == 0) {
      cnt++;
      y /= i;
    }
    mp2[i] = cnt * b;
  }
  if (y > 1) {
    mp2[y] = b;
  }

  bool ok = true;
  for (auto i : mp2) {
    if (mp1[i.first] >= i.second) continue;
    ok = false;
  }

  if (ok) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}
0