結果
問題 | No.376 立方体のN等分 (2) |
ユーザー |
![]() |
提出日時 | 2016-06-05 00:06:39 |
言語 | C90 (gcc 12.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 512 bytes |
コンパイル時間 | 159 ms |
コンパイル使用メモリ | 23,424 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-10-08 12:59:56 |
合計ジャッジ時間 | 35,332 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 TLE * 4 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:5: 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--){ //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; }