結果

問題 No.375 立方体のN等分 (1)
ユーザー recososorecososo
提出日時 2020-02-27 14:37:35
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 626 bytes
コンパイル時間 1,571 ms
コンパイル使用メモリ 166,528 KB
実行使用メモリ 8,832 KB
最終ジャッジ日時 2024-04-21 16:58:18
合計ジャッジ時間 12,453 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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