結果

問題 No.376 立方体のN等分 (2)
ユーザー kapokapo
提出日時 2016-06-09 21:04:47
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 806 bytes
コンパイル時間 803 ms
コンパイル使用メモリ 64,624 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-17 12:41:09
合計ジャッジ時間 10,006 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
5,248 KB
testcase_01 AC 101 ms
5,376 KB
testcase_02 AC 102 ms
5,376 KB
testcase_03 AC 99 ms
5,376 KB
testcase_04 AC 99 ms
5,376 KB
testcase_05 AC 105 ms
5,376 KB
testcase_06 AC 105 ms
5,376 KB
testcase_07 AC 103 ms
5,376 KB
testcase_08 WA -
testcase_09 AC 104 ms
5,376 KB
testcase_10 AC 175 ms
5,376 KB
testcase_11 AC 105 ms
5,376 KB
testcase_12 AC 102 ms
5,376 KB
testcase_13 AC 101 ms
5,376 KB
testcase_14 AC 102 ms
5,376 KB
testcase_15 WA -
testcase_16 AC 912 ms
5,376 KB
testcase_17 AC 103 ms
5,376 KB
testcase_18 WA -
testcase_19 AC 103 ms
5,376 KB
testcase_20 AC 105 ms
5,376 KB
testcase_21 AC 869 ms
5,376 KB
testcase_22 AC 103 ms
5,376 KB
testcase_23 AC 875 ms
5,376 KB
testcase_24 AC 866 ms
5,376 KB
testcase_25 AC 104 ms
5,376 KB
testcase_26 AC 952 ms
5,376 KB
testcase_27 WA -
testcase_28 AC 105 ms
5,376 KB
testcase_29 AC 101 ms
5,376 KB
testcase_30 AC 98 ms
5,376 KB
testcase_31 WA -
testcase_32 AC 102 ms
5,376 KB
testcase_33 AC 102 ms
5,376 KB
testcase_34 WA -
testcase_35 AC 106 ms
5,376 KB
testcase_36 AC 104 ms
5,376 KB
testcase_37 AC 101 ms
5,376 KB
testcase_38 AC 102 ms
5,376 KB
testcase_39 AC 101 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define pii pair<int, int>
#define ll long long
using namespace std; 

#define MAX 1000000000000
#define LMAX 10000000

ll N;
vector<ll> V;

void divisor(void)
{
	rep(i,2,LMAX) {
		if(N%i == 0) V.pb(i);
	}
}

int main(void)
{
	cin >> N;
	ll max = N-1;
	ll min = N-1;

	divisor();

	// for(auto i:V) cout << i << " ";	cout << endl;

	rep(i,0,V.size()){
		ll ti = N / V[i];
		rep(j,0,V.size()) {
			if(ti % V[j]) continue;
			ll tj = ti / V[j];
			// printf("V[i]=%lld V[j]=%lld tj=%lld\n",V[i],V[j],tj);
			min = std::min(min, V[i]+V[j]+tj-3);
		}
	}

	cout << min << " " << max << endl;

	return 0;
}
0