結果
| 問題 |
No.376 立方体のN等分 (2)
|
| コンテスト | |
| ユーザー |
Lay_ec
|
| 提出日時 | 2016-06-05 00:07:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 514 bytes |
| コンパイル時間 | 631 ms |
| コンパイル使用メモリ | 68,224 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-08 13:02:18 |
| 合計ジャッジ時間 | 36,167 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 35 TLE * 3 |
ソースコード
#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;
}
Lay_ec