結果

問題 No.1330 Multiply or Divide
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2021-01-08 21:35:32
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 587 bytes
コンパイル時間 1,474 ms
コンパイル使用メモリ 163,448 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-28 02:17:17
合計ジャッジ時間 4,784 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 70 ms
5,376 KB
testcase_02 WA -
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 38 ms
5,376 KB
testcase_07 WA -
testcase_08 AC 101 ms
5,376 KB
testcase_09 AC 103 ms
5,376 KB
testcase_10 AC 102 ms
5,376 KB
testcase_11 AC 98 ms
5,376 KB
testcase_12 AC 100 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 1 ms
5,376 KB
testcase_17 WA -
testcase_18 AC 97 ms
5,376 KB
testcase_19 AC 97 ms
5,376 KB
testcase_20 AC 97 ms
5,376 KB
testcase_21 AC 97 ms
5,376 KB
testcase_22 AC 99 ms
5,376 KB
testcase_23 WA -
testcase_24 AC 1 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 WA -
testcase_27 AC 1 ms
5,376 KB
testcase_28 AC 2 ms
5,376 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 2 ms
5,376 KB
testcase_31 AC 1 ms
5,376 KB
testcase_32 AC 1 ms
5,376 KB
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 72 ms
5,376 KB
testcase_35 AC 21 ms
5,376 KB
testcase_36 AC 64 ms
5,376 KB
testcase_37 AC 57 ms
5,376 KB
testcase_38 AC 36 ms
5,376 KB
testcase_39 AC 25 ms
5,376 KB
testcase_40 AC 31 ms
5,376 KB
testcase_41 AC 16 ms
5,376 KB
testcase_42 AC 53 ms
5,376 KB
testcase_43 AC 62 ms
5,376 KB
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *   @FileName	a.cpp
 *   @Author	kanpurin
 *   @Created	2021.01.08 21:35:28
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

int main() {
    int n,m,p;cin >> n >> m >> p;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        while (a[i] % p == 0) {
            a[i] /= p;
        }
    }
    sort(a.rbegin(), a.rend());
    int ans = 0;
    ll x = 1;
    if (a[0] == 1) {
        cout << -1 << endl;
        return 0;
    }
    while(x < m) {
        x *= a[0];
        ans++;
    }
    cout << ans << endl;
    return 0;
}
0