結果

問題 No.375 立方体のN等分 (1)
ユーザー sekiya9311sekiya9311
提出日時 2016-06-05 01:23:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,527 bytes
コンパイル時間 1,030 ms
コンパイル使用メモリ 112,812 KB
実行使用メモリ 9,432 KB
最終ジャッジ日時 2024-04-17 03:37:08
合計ジャッジ時間 7,001 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <random>

#define REP(i,n) for(long (i)=0;(i)<(n);(i)++)
#define FOR(i,a,b) for(long (i)=(a);(i)<(b);(i)++)
#define RREP(i,a) for(long (i)=(a)-1;(i)>=0;(i)--)
#define FORR(i,a,b) for(long (i)=(a)-1;(i)>=(b);(i)--)
#define MOD 1000000007
#define PI acos(-1.0)
#define DEBUG(C) cout<<C<<endl;
#define PII pair<int,int>
#define PLL pair<long,long>
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define RSORT(a) sort((a).begin(),(a).end(),greater<int>())

typedef long long LL;
typedef unsigned long long ULL;

using namespace std;

int main(void){
    LL N; cin>>N;
    vector<LL> va,vb,vc;
    LL tmin=N-1;
    for(LL i=2;i*i*i<=N;i++){
		LL nbufi=N,a,b,c;
		if(nbufi%i==0){
			a=i; nbufi/=a;
			for(LL j=a+1;j*j<=N;j++){
				LL nbufj=nbufi;
				if(nbufj%j==0){
					b=j; nbufj/=b; c=nbufj;
					va.push_back(a);
					vb.push_back(b);
					vc.push_back(c);
				}
			}
		}
	}
	for(LL i=0;i<va.size();i++){
		//cout<<va[i]<<" "<<vb[i]<<" "<<vc[i]<<endl;
		tmin=min(tmin,(LL)va[i]+vb[i]+vc[i]);
	}
	tmin-=3;
    cout<<tmin<<" "<<N-1<<endl;
}
0