結果

問題 No.375 立方体のN等分 (1)
ユーザー tabataba
提出日時 2017-05-19 22:43:23
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 630 bytes
コンパイル時間 997 ms
コンパイル使用メモリ 111,772 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 02:51:18
合計ジャッジ時間 2,503 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 51 ms
4,348 KB
testcase_15 WA -
testcase_16 AC 8 ms
4,348 KB
testcase_17 WA -
testcase_18 AC 57 ms
4,348 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 6 ms
4,348 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 5 ms
4,348 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 5 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.f/3)+1,minabc=n;
	for(a=1;a<nr3;a++){
		int64_t na=n%a;
		if(na)continue;
		int64_t nr2=sqrt(n/a);
		for(b=1;b<nr2;b++){
			int64_t nb=n%b;
			if(nb)continue;
			c=n/a/b;
			minabc=min(minabc,a+b+c-3);
		}
		
	}
	printf("%ld %ld\n",minabc,n-1);
	return 0;
}
0