結果

問題 No.375 立方体のN等分 (1)
ユーザー ngtkanangtkana
提出日時 2020-04-05 19:49:39
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 757 bytes
コンパイル時間 1,742 ms
コンパイル使用メモリ 201,692 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-17 03:45:29
合計ジャッジ時間 3,450 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
using lint=long long;
using lubl=long double;
void cmn(lint&x,lint y){if(x>y)x=y;}
void cmx(lint&x,lint y){if(x<y)x=y;}
int main(){
    std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
    std::cout.setf(std::ios_base::fixed);std::cout.precision(15);
    lint n;std::cin>>n;
    std::vector<lint>div;
    for(lint i=1;i*i<=n;i++){
        if(n%i)continue;
        div.push_back(i);
        if(i*i!=n)div.push_back(n/i);
    }
    lint min=std::numeric_limits<lint>::max();
    lint max=0;
    for(lint x:div){
    for(lint y:div)if(y<=n/x){
        lint z=n/(x*y);
        lint now=x+y+z-3;
        cmn(min,now);
        cmx(max,now);
    }}
    std::cout<<min<<' '<<max<<'\n';
}
0