結果

問題 No.376 立方体のN等分 (2)
ユーザー Lay_ecLay_ec
提出日時 2016-06-04 23:59:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 623 bytes
コンパイル時間 834 ms
コンパイル使用メモリ 88,912 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 03:15:34
合計ジャッジ時間 23,739 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 391 ms
5,376 KB
testcase_03 AC 766 ms
5,376 KB
testcase_04 AC 535 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 12 ms
5,376 KB
testcase_09 AC 51 ms
5,376 KB
testcase_10 AC 690 ms
5,376 KB
testcase_11 AC 150 ms
5,376 KB
testcase_12 AC 330 ms
5,376 KB
testcase_13 AC 160 ms
5,376 KB
testcase_14 AC 195 ms
5,376 KB
testcase_15 AC 147 ms
5,376 KB
testcase_16 AC 4,511 ms
5,376 KB
testcase_17 AC 343 ms
5,376 KB
testcase_18 AC 167 ms
5,376 KB
testcase_19 AC 622 ms
5,376 KB
testcase_20 AC 203 ms
5,376 KB
testcase_21 AC 4,978 ms
5,376 KB
testcase_22 AC 184 ms
5,376 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 194 ms
5,376 KB
testcase_26 TLE -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
#include <queue>
#include <stack>

using namespace std;

int main()
{
	
	long long n;
	scanf("%lld",&n);
	long long Tmin=2*n;
	
	long long a=sqrt(n)+2LL,b,m,M;
	
	while(a--){
		if(a==0) break;
		if(n%a) continue;
		m=n/a;
		b=sqrt(m)+2;
		while(b--){
			if(b==0) break;
			if(m%b==0 && Tmin>a+b+m/b) Tmin=a+b+m/b;
		}
	}
	printf("%lld %lld\n",Tmin-3,n-1);
	//cout<<Tmin-3<<" "<<n-1<<endl;

	
	return 0;
}
0