結果
| 問題 |
No.375 立方体のN等分 (1)
|
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-04-05 19:49:39 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 757 bytes |
| コンパイル時間 | 1,992 ms |
| コンパイル使用メモリ | 194,508 KB |
| 最終ジャッジ日時 | 2025-01-09 14:23:14 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 10 WA * 22 |
ソースコード
#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';
}
ngtkana