結果

問題 No.376 立方体のN等分 (2)
ユーザー hanorver
提出日時 2016-06-05 10:20:09
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 507 bytes
コンパイル時間 1,417 ms
コンパイル使用メモリ 62,648 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-08 15:15:54
合計ジャッジ時間 29,392 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 35 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<cmath>

int main() {
	long long n;

	std::cin >> n;

	long long max = n - 1, min = n - 1;

	long long a, b, c, end, end2;

	end2 = std::pow(n, 0.33333333333333) + 1;

	for (long long i = 1; i <= end2; ++i) {
		if (n % i != 0) continue;
		long long tn = n / i;
		end = sqrt(tn);
		for (long long j = i; j <= end; ++j) {
			if (tn % j != 0) continue;
			min = std::min(min, i + j + tn / j);
		}
	}

	std::cout << min - 3 << " " << max << std::endl;
	return 0;
}
0