結果

問題 No.376 立方体のN等分 (2)
ユーザー Lay_ecLay_ec
提出日時 2016-06-05 01:25:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,699 ms / 5,000 ms
コード長 689 bytes
コンパイル時間 898 ms
コンパイル使用メモリ 92,112 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-24 13:43:20
合計ジャッジ時間 12,394 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 88 ms
5,376 KB
testcase_03 AC 86 ms
5,376 KB
testcase_04 AC 101 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 6 ms
5,376 KB
testcase_09 AC 23 ms
5,376 KB
testcase_10 AC 121 ms
5,376 KB
testcase_11 AC 46 ms
5,376 KB
testcase_12 AC 62 ms
5,376 KB
testcase_13 AC 64 ms
5,376 KB
testcase_14 AC 71 ms
5,376 KB
testcase_15 AC 80 ms
5,376 KB
testcase_16 AC 1,475 ms
5,376 KB
testcase_17 AC 89 ms
5,376 KB
testcase_18 AC 92 ms
5,376 KB
testcase_19 AC 94 ms
5,376 KB
testcase_20 AC 96 ms
5,376 KB
testcase_21 AC 1,487 ms
5,376 KB
testcase_22 AC 100 ms
5,376 KB
testcase_23 AC 1,550 ms
5,376 KB
testcase_24 AC 1,486 ms
5,376 KB
testcase_25 AC 103 ms
5,376 KB
testcase_26 AC 1,699 ms
5,376 KB
testcase_27 AC 105 ms
5,376 KB
testcase_28 AC 105 ms
5,376 KB
testcase_29 AC 105 ms
5,376 KB
testcase_30 AC 105 ms
5,376 KB
testcase_31 AC 105 ms
5,376 KB
testcase_32 AC 105 ms
5,376 KB
testcase_33 AC 105 ms
5,376 KB
testcase_34 AC 105 ms
5,376 KB
testcase_35 AC 105 ms
5,376 KB
testcase_36 AC 104 ms
5,376 KB
testcase_37 AC 104 ms
5,376 KB
testcase_38 AC 105 ms
5,376 KB
testcase_39 AC 105 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

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;
	cin>>n;
	
	vector<long long> div;
	for(long long d=1;d*d<=n;d++){
		if(n%d==0){
			div.push_back(d);
			if(d*d!=n) div.push_back(n/d);
		}
	}
	
	long long Tmin=2*n;
	for(int i=0;i<div.size();i++){
		for(int j=i;j<div.size();j++){
			if(n%div[i]==0 && (n/div[i])%div[j]==0)
			Tmin=min(Tmin,div[i]+div[j]+n/div[i]/div[j]);
		}
	}
	cout<<Tmin-3<<" "<<n-1<<endl;
    
    return 0;
}
0