結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー 夜
提出日時 2021-07-22 04:18:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,050 bytes
コンパイル時間 679 ms
コンパイル使用メモリ 92,016 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-24 20:27:32
合計ジャッジ時間 38,516 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 1,931 ms
4,376 KB
testcase_02 AC 1,909 ms
4,376 KB
testcase_03 AC 1,919 ms
4,376 KB
testcase_04 AC 1,916 ms
4,380 KB
testcase_05 AC 1,951 ms
4,380 KB
testcase_06 AC 1,903 ms
4,380 KB
testcase_07 AC 1,952 ms
4,376 KB
testcase_08 AC 1,912 ms
4,380 KB
testcase_09 AC 1,928 ms
4,384 KB
testcase_10 AC 1,509 ms
4,376 KB
testcase_11 AC 1,442 ms
4,380 KB
testcase_12 AC 1,452 ms
4,380 KB
testcase_13 AC 1,453 ms
4,376 KB
testcase_14 AC 1,445 ms
4,380 KB
testcase_15 AC 1,430 ms
4,380 KB
testcase_16 AC 1,436 ms
4,376 KB
testcase_17 AC 1,453 ms
4,376 KB
testcase_18 AC 1,465 ms
4,380 KB
testcase_19 AC 16 ms
4,380 KB
testcase_20 AC 17 ms
4,376 KB
testcase_21 AC 16 ms
4,380 KB
testcase_22 AC 15 ms
4,376 KB
testcase_23 AC 16 ms
4,376 KB
testcase_24 AC 16 ms
4,376 KB
testcase_25 AC 16 ms
4,376 KB
testcase_26 AC 15 ms
4,376 KB
testcase_27 AC 16 ms
4,376 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 AC 1 ms
4,376 KB
testcase_35 AC 1 ms
4,376 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 AC 2 ms
4,376 KB
testcase_38 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long p[12] = { 2,3,5,7,11,13,17,19,23,29,31,37 };
int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int t;
	cin >> t;
	for (int i = 0; i < t; i++) {
		long long x, x1;
		cin >> x;
		long long ans = 100000000000000;
		int co[12] = {}, co1[12] = {};
		for (long long j = 2; j < 35; j++) {
			for (int k = 0; k < 12; k++) {
				x1 = x;
				co[k] = 1;
				while (x1 % p[k] == 0) {
					x1 /= p[k];
					co[k]++;
				}
				co1[k] = co[k];
			}
			for (int k = 0; k < 12; k++) {
				x1 = j;
				while (x1 % p[k] == 0) {
					x1 /= p[k];
					co1[k]++;
				}
			}
			long long c = 1, c1 = 1;
			for (int k = 0; k < 12; k++) {
				c *= co[k];
				c1 *= co1[k];
			}
			if (c * 2 == c1) {
				ans = min(ans, x * j);
			}
		}
		cout << ans << endl;
	}
}
0