結果

問題 No.376 立方体のN等分 (2)
ユーザー hanorverhanorver
提出日時 2016-06-05 10:18:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 507 bytes
コンパイル時間 572 ms
コンパイル使用メモリ 71,664 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 04:32:12
合計ジャッジ時間 20,524 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 363 ms
5,376 KB
testcase_03 AC 759 ms
5,376 KB
testcase_04 AC 512 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 10 ms
5,376 KB
testcase_09 AC 35 ms
5,376 KB
testcase_10 AC 629 ms
5,376 KB
testcase_11 AC 125 ms
5,376 KB
testcase_12 AC 309 ms
5,376 KB
testcase_13 AC 119 ms
5,376 KB
testcase_14 AC 154 ms
5,376 KB
testcase_15 AC 89 ms
5,376 KB
testcase_16 AC 4,001 ms
5,376 KB
testcase_17 AC 303 ms
5,376 KB
testcase_18 AC 102 ms
5,376 KB
testcase_19 AC 610 ms
5,376 KB
testcase_20 AC 131 ms
5,376 KB
testcase_21 AC 4,503 ms
5,376 KB
testcase_22 AC 109 ms
5,376 KB
testcase_23 AC 4,835 ms
5,376 KB
testcase_24 AC 4,844 ms
5,376 KB
testcase_25 AC 110 ms
5,376 KB
testcase_26 TLE -
testcase_27 AC 186 ms
5,376 KB
testcase_28 AC 110 ms
5,376 KB
testcase_29 AC 295 ms
5,376 KB
testcase_30 AC 196 ms
5,376 KB
testcase_31 AC 110 ms
5,376 KB
testcase_32 AC 186 ms
5,376 KB
testcase_33 AC 110 ms
5,376 KB
testcase_34 AC 112 ms
5,376 KB
testcase_35 AC 239 ms
5,376 KB
testcase_36 AC 109 ms
5,376 KB
testcase_37 AC 110 ms
5,376 KB
testcase_38 AC 255 ms
5,376 KB
testcase_39 AC 289 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

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 - 3);
		}
	}

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