結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー 夜
提出日時 2021-07-22 04:30:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,288 ms / 2,000 ms
コード長 1,031 bytes
コンパイル時間 950 ms
コンパイル使用メモリ 93,744 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-14 05:35:25
合計ジャッジ時間 11,294 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,288 ms
6,816 KB
testcase_01 AC 368 ms
6,940 KB
testcase_02 AC 360 ms
6,944 KB
testcase_03 AC 365 ms
6,944 KB
testcase_04 AC 368 ms
6,944 KB
testcase_05 AC 362 ms
6,944 KB
testcase_06 AC 369 ms
6,944 KB
testcase_07 AC 370 ms
6,940 KB
testcase_08 AC 363 ms
6,944 KB
testcase_09 AC 362 ms
6,940 KB
testcase_10 AC 188 ms
6,940 KB
testcase_11 AC 192 ms
6,944 KB
testcase_12 AC 195 ms
6,940 KB
testcase_13 AC 192 ms
6,944 KB
testcase_14 AC 191 ms
6,940 KB
testcase_15 AC 192 ms
6,944 KB
testcase_16 AC 196 ms
6,944 KB
testcase_17 AC 199 ms
6,944 KB
testcase_18 AC 194 ms
6,944 KB
testcase_19 AC 4 ms
6,940 KB
testcase_20 AC 4 ms
6,940 KB
testcase_21 AC 4 ms
6,940 KB
testcase_22 AC 4 ms
6,940 KB
testcase_23 AC 4 ms
6,940 KB
testcase_24 AC 4 ms
6,940 KB
testcase_25 AC 4 ms
6,940 KB
testcase_26 AC 4 ms
6,940 KB
testcase_27 AC 4 ms
6,940 KB
testcase_28 AC 2 ms
6,940 KB
testcase_29 AC 2 ms
6,944 KB
testcase_30 AC 2 ms
6,940 KB
testcase_31 AC 2 ms
6,940 KB
testcase_32 AC 2 ms
6,940 KB
testcase_33 AC 2 ms
6,940 KB
testcase_34 AC 2 ms
6,944 KB
testcase_35 AC 2 ms
6,944 KB
testcase_36 AC 2 ms
6,940 KB
testcase_37 AC 2 ms
6,944 KB
testcase_38 AC 2 ms
6,944 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[13] = { 2,3,5,7,11,13,17,19,23,29,31,37 };
int co[13] = {}, co1[35][13] = {};
int main() {
	for (int i = 2; i < 33; i++) {
		for (int j = 0; j < 12; j++) {
			int i1 = i;
			while (i1 % p[j] == 0) {
				i1 /= p[j];
				co1[i][j]++;
			}
		}
	}
	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;
		for (long long j = 2; j < 33; j++) {
			for (int k = 0; k < 12; k++) {
				x1 = x;
				co[k] = 1;
				while (x1 % p[k] == 0) {
					x1 /= p[k];
					co[k]++;
				}
			}
			long long c = 1, c1 = 1;
			for (int k = 0; k < 12; k++) {
				c *= co[k];
				c1 *= co[k] + co1[j][k];
			}
			if (c * 2 == c1) {
				cout << x * j << endl;
				break;
			}
		}
	}
}
0