結果

問題 No.375 立方体のN等分 (1)
ユーザー kotamanegikotamanegi
提出日時 2016-08-16 21:00:44
言語 C++11
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 925 bytes
コンパイル時間 895 ms
コンパイル使用メモリ 85,848 KB
実行使用メモリ 8,576 KB
最終ジャッジ日時 2024-11-07 18:20:14
合計ジャッジ時間 7,448 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 2 WA * 1 TLE * 1 -- * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include<map>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <iomanip>
using namespace std;
#define MAX_MOD 1000000007
#define REP(i,n) for(int i = 0;i < n;++i)
int main(){
	long long n;
	cin >> n;
	long long T_max = n - 1;
	long long hoge = ceil(pow(n, 3.0));
	long long wow = 1000000000000;
	for (long long i = hoge;i >= 1;--i) {
		if (n%i == 0) {
			long long pre_ans = i;
			int extu = n / i;
			for (int q = 1;q <= sqrt(extu) + 1;++q) {
				if (extu % q == 0) {
					wow = min(wow, pre_ans + q + extu / q);
				}
			}
		}
	}
	cout << wow-3 << " " << T_max << endl;
	return 0;
}
0