結果

問題 No.375 立方体のN等分 (1)
ユーザー kotamanegikotamanegi
提出日時 2016-08-16 21:03:22
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 936 bytes
コンパイル時間 838 ms
コンパイル使用メモリ 86,212 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-25 07:59:57
合計ジャッジ時間 1,853 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 6 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 6 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 15 ms
5,376 KB
testcase_15 WA -
testcase_16 AC 2 ms
5,376 KB
testcase_17 WA -
testcase_18 AC 16 ms
5,376 KB
testcase_19 WA -
testcase_20 AC 2 ms
5,376 KB
testcase_21 WA -
testcase_22 AC 35 ms
5,376 KB
testcase_23 WA -
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 6 ms
5,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます

ソースコード

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, (double)1/3));
	long long wow = 1000000000000;
	for (long long i = hoge+10;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