結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー ぷらぷら
提出日時 2021-07-21 22:15:15
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,067 ms / 2,000 ms
コード長 977 bytes
コンパイル時間 3,112 ms
コンパイル使用メモリ 198,944 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-07-26 15:27:46
合計ジャッジ時間 24,681 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,067 ms
4,376 KB
testcase_01 AC 1,008 ms
4,376 KB
testcase_02 AC 1,000 ms
4,380 KB
testcase_03 AC 998 ms
4,376 KB
testcase_04 AC 1,012 ms
4,384 KB
testcase_05 AC 1,013 ms
4,384 KB
testcase_06 AC 1,000 ms
4,380 KB
testcase_07 AC 997 ms
4,380 KB
testcase_08 AC 999 ms
4,376 KB
testcase_09 AC 1,002 ms
4,376 KB
testcase_10 AC 824 ms
4,376 KB
testcase_11 AC 840 ms
4,380 KB
testcase_12 AC 834 ms
4,376 KB
testcase_13 AC 843 ms
4,380 KB
testcase_14 AC 837 ms
4,376 KB
testcase_15 AC 836 ms
4,376 KB
testcase_16 AC 837 ms
4,380 KB
testcase_17 AC 839 ms
4,380 KB
testcase_18 AC 841 ms
4,376 KB
testcase_19 AC 10 ms
4,380 KB
testcase_20 AC 10 ms
4,376 KB
testcase_21 AC 11 ms
4,376 KB
testcase_22 AC 10 ms
4,380 KB
testcase_23 AC 10 ms
4,384 KB
testcase_24 AC 10 ms
4,380 KB
testcase_25 AC 10 ms
4,380 KB
testcase_26 AC 10 ms
4,380 KB
testcase_27 AC 10 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 1 ms
4,384 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 1 ms
4,380 KB
testcase_33 AC 2 ms
4,384 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 2 ms
4,376 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 AC 2 ms
4,384 KB
testcase_38 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    int T;
    cin >> T;
    vector<int>prime = {2,3,5,7,11,13,17,19,23,29,31,37,41};
    while (T--) {
        long long X;
        cin >> X;
        long long ans = 1001001001001001001;
        for(int i = 2; i <= 43; i++) {
            long long tmp1 = 1,tmp2 = 1;
            for(int j = 0; j < prime.size(); j++) {
                if(i%prime[j]) {
                    continue;
                }
                long long Y = X,Z = i;
                int y = 0,z = 0;
                while (Y%prime[j] == 0) {
                    Y /= prime[j];
                    y++;
                }
                while (Z%prime[j] == 0) {
                    Z /= prime[j];
                    z++;
                }
                tmp1 *= y+1;
                tmp2 *= y+z+1;
            }
            if(tmp1*2 == tmp2) {
                ans = min(ans,X*i);
            }
        }
        cout << ans << endl;
    }
}
0