結果
| 問題 |
No.376 立方体のN等分 (2)
|
| コンテスト | |
| ユーザー |
Lay_ec
|
| 提出日時 | 2016-06-04 23:59:08 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 384 bytes |
| コンパイル時間 | 552 ms |
| コンパイル使用メモリ | 23,424 KB |
| 実行使用メモリ | 8,480 KB |
| 最終ジャッジ日時 | 2024-10-08 12:51:44 |
| 合計ジャッジ時間 | 35,847 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 20 TLE * 5 -- * 13 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%lld",&n);
| ^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <math.h>
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--){
if(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