結果

問題 No.375 立方体のN等分 (1)
ユーザー ixmelixmel
提出日時 2016-07-10 14:49:02
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 988 bytes
コンパイル時間 676 ms
コンパイル使用メモリ 82,156 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-21 11:46:38
合計ジャッジ時間 2,293 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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 int inf=1<<30;
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);
		if(t==1)out=min(out,i);
		else{
			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