結果

問題 No.375 立方体のN等分 (1)
ユーザー tabataba
提出日時 2017-05-19 23:35:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 699 bytes
コンパイル時間 1,215 ms
コンパイル使用メモリ 116,904 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 02:53:13
合計ジャッジ時間 2,239 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 WA -
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,348 KB
testcase_10 WA -
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 3 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 12 ms
4,348 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 13 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 WA -
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 32 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 2 ms
4,348 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 2 ms
4,348 KB
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <cmath>
#include <cassert>
#include <random>
#include <vector>
#include <algorithm>
#include <array>
#include <functional>
#include <utility>
#include <regex>
#include <tuple>
#include <map>
#include <set>
#include <iostream>

using namespace std;

int main(){
	int64_t n,t;
	-scanf("%ld",&n);
	t=n;
	int64_t a,b,c,nr3=pow(n,1.0/3.0)+1,minabc=n*2;
	for(a=1;a<nr3;a++){
		int64_t na=n%a;
		if(na)continue;
		int64_t nr2=pow(n,0.5)+1;
		for(b=1;b<nr3;b++){
			int64_t nb=(n/a)%b;
			if(nb)continue;
			c=n/a/b;
			minabc=min(minabc,a+b+c-3);
			//printf("%ld	%ld	%ld	%ld	%ld\n",a,b,c,a*b*c,a+b+c-3);
		}
		
	}
	printf("%ld %ld\n",minabc,n-1);
	return 0;
}
0