結果

問題 No.375 立方体のN等分 (1)
ユーザー itezpace
提出日時 2016-06-05 07:27:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 740 ms
コンパイル使用メモリ 58,200 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-08 14:08:47
合計ジャッジ時間 1,656 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 WA * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:20:13: warning: ‘a’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   20 |       tmin=a+b+c-3;
      |            ~^~

ソースコード

diff #

#include <iostream>
#include <cmath>
using namespace std;
typedef long long ll;
int main(){
  ll n; cin>>n;
  ll tmin,tmax;
  tmax=n-1;
  tmin=n-1;
  ll a,b,c;
  ll x=1;
  for(ll i=2; i<=cbrt(n); ++i){
    if(n%i==0){
      x=n/i;
      a=i;
    }
    if(x%i==0){
      b=i;
      c=x/i;
      tmin=a+b+c-3;
    }
  }
  cout<<tmin<<" "<<tmax<<endl;
  return 0;
}
0