結果

問題 No.376 立方体のN等分 (2)
ユーザー ixmelixmel
提出日時 2016-07-10 14:56:46
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 973 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 82,080 KB
実行使用メモリ 8,448 KB
最終ジャッジ日時 2024-04-21 11:47:15
合計ジャッジ時間 21,871 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 343 ms
5,376 KB
testcase_03 AC 728 ms
5,376 KB
testcase_04 AC 480 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 8 ms
5,376 KB
testcase_09 AC 33 ms
5,376 KB
testcase_10 AC 722 ms
5,376 KB
testcase_11 AC 113 ms
5,376 KB
testcase_12 AC 291 ms
5,376 KB
testcase_13 AC 107 ms
5,376 KB
testcase_14 AC 136 ms
5,376 KB
testcase_15 AC 78 ms
5,376 KB
testcase_16 AC 4,797 ms
5,376 KB
testcase_17 AC 291 ms
5,376 KB
testcase_18 AC 91 ms
5,376 KB
testcase_19 AC 564 ms
5,376 KB
testcase_20 AC 117 ms
5,376 KB
testcase_21 TLE -
testcase_22 AC 95 ms
5,376 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
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<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const ll inf=1e17;
int main(){
	ll in;
	cin>>in;
	ll out=inf;
	for(ll i=1;i*i<=in;i++)if(in%(i+1)==0){
		ll t=in/(i+1);
		out=min(out,i+t-1);
		for(ll j=1;j*j<=t;j++)if(t%(j+1)==0){
			out=min(out,i+j+t/(j+1)-1);
		}
	}
	if(out==inf)out=in-1;
	cout<<out<<" "<<in-1<<endl;
}




0