結果

問題 No.376 立方体のN等分 (2)
ユーザー recososorecososo
提出日時 2022-06-28 21:43:58
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 535 bytes
コンパイル時間 1,859 ms
コンパイル使用メモリ 204,112 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-01 11:55:35
合計ジャッジ時間 30,842 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 318 ms
6,940 KB
testcase_03 AC 687 ms
6,944 KB
testcase_04 AC 444 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 9 ms
6,944 KB
testcase_09 AC 31 ms
6,940 KB
testcase_10 AC 584 ms
6,944 KB
testcase_11 AC 108 ms
6,940 KB
testcase_12 AC 271 ms
6,944 KB
testcase_13 AC 103 ms
6,940 KB
testcase_14 AC 140 ms
6,944 KB
testcase_15 AC 78 ms
6,940 KB
testcase_16 AC 3,771 ms
6,940 KB
testcase_17 AC 273 ms
6,940 KB
testcase_18 AC 90 ms
6,944 KB
testcase_19 AC 531 ms
6,940 KB
testcase_20 AC 118 ms
6,940 KB
testcase_21 AC 4,226 ms
6,940 KB
testcase_22 AC 95 ms
6,940 KB
testcase_23 AC 4,428 ms
6,944 KB
testcase_24 AC 4,525 ms
6,944 KB
testcase_25 AC 94 ms
6,944 KB
testcase_26 AC 4,687 ms
6,944 KB
testcase_27 WA -
testcase_28 AC 94 ms
6,940 KB
testcase_29 AC 254 ms
6,940 KB
testcase_30 AC 160 ms
6,940 KB
testcase_31 AC 97 ms
6,940 KB
testcase_32 AC 173 ms
6,940 KB
testcase_33 AC 106 ms
6,940 KB
testcase_34 AC 105 ms
6,944 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 AC 252 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
    ll n;cin >> n;
    vector<ll> v;
    for(ll i=1;i*i*i<=n;i++){
        if(n%i==0){
            v.push_back(i);
            if(i*i!=n){
                v.push_back(n/i);
            }
        }
    }
    ll p=1e12;
    int t=v.size();
    for(int i=0;i<t;i++){
        ll num=n/v[i];
        for(ll j=1;j*j<=num;j++){
            if(num%j==0){
                p=min(p,v[i]+j+num/j-3);
            }
        }
    }
    cout << p << " " << n-1 << endl;
}
0