結果

問題 No.376 立方体のN等分 (2)
ユーザー Lay_ecLay_ec
提出日時 2016-06-05 00:07:37
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 514 bytes
コンパイル時間 491 ms
コンパイル使用メモリ 69,156 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-17 03:19:26
合計ジャッジ時間 33,637 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 380 ms
6,940 KB
testcase_03 AC 736 ms
6,944 KB
testcase_04 AC 521 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 11 ms
6,940 KB
testcase_09 AC 50 ms
6,940 KB
testcase_10 AC 659 ms
6,940 KB
testcase_11 AC 151 ms
6,940 KB
testcase_12 AC 322 ms
6,944 KB
testcase_13 AC 154 ms
6,940 KB
testcase_14 AC 188 ms
6,940 KB
testcase_15 AC 147 ms
6,944 KB
testcase_16 AC 4,297 ms
6,944 KB
testcase_17 AC 331 ms
6,940 KB
testcase_18 AC 166 ms
6,944 KB
testcase_19 AC 604 ms
6,940 KB
testcase_20 AC 193 ms
6,940 KB
testcase_21 AC 4,679 ms
6,944 KB
testcase_22 AC 174 ms
6,940 KB
testcase_23 AC 4,928 ms
6,944 KB
testcase_24 AC 4,919 ms
6,940 KB
testcase_25 AC 182 ms
6,944 KB
testcase_26 TLE -
testcase_27 AC 252 ms
6,944 KB
testcase_28 AC 187 ms
6,940 KB
testcase_29 AC 341 ms
6,944 KB
testcase_30 AC 245 ms
6,940 KB
testcase_31 AC 179 ms
6,944 KB
testcase_32 AC 247 ms
6,940 KB
testcase_33 AC 181 ms
6,940 KB
testcase_34 AC 180 ms
6,940 KB
testcase_35 AC 295 ms
6,944 KB
testcase_36 AC 184 ms
6,940 KB
testcase_37 AC 180 ms
6,944 KB
testcase_38 AC 300 ms
6,940 KB
testcase_39 AC 327 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>


int main()
{
    
    long long n;
    scanf("%lld",&n);
    long long Tmin=2*n;
    
    long long a=sqrt(n)+2LL,b,m,M;
    
    while(a--){
        if(a==0) break;
        if(n%a) continue;
        m=n/a;
        b=sqrt(m)+2;
        while(b--){
			//printf("%lld\n",b);
            if(b==a-1 || b==0) break;
            if(m%b==0 && Tmin>a+b+m/b) Tmin=a+b+m/b;
        }
    }
    printf("%lld %lld\n",Tmin-3,n-1);
    //cout<<Tmin-3<<" "<<n-1<<endl;

    
    return 0;
}
0