結果

問題 No.375 立方体のN等分 (1)
ユーザー 0w10w1
提出日時 2016-11-29 15:49:53
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 347 ms / 5,000 ms
コード長 451 bytes
コンパイル時間 1,473 ms
コンパイル使用メモリ 164,568 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-18 09:41:41
合計ジャッジ時間 10,856 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 256 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 7 ms
4,376 KB
testcase_07 AC 42 ms
4,376 KB
testcase_08 AC 58 ms
4,376 KB
testcase_09 AC 113 ms
4,376 KB
testcase_10 AC 166 ms
4,380 KB
testcase_11 AC 176 ms
4,380 KB
testcase_12 AC 202 ms
4,380 KB
testcase_13 AC 235 ms
4,376 KB
testcase_14 AC 258 ms
4,376 KB
testcase_15 AC 267 ms
4,380 KB
testcase_16 AC 283 ms
4,376 KB
testcase_17 AC 297 ms
4,376 KB
testcase_18 AC 305 ms
4,380 KB
testcase_19 AC 305 ms
4,376 KB
testcase_20 AC 332 ms
4,376 KB
testcase_21 AC 333 ms
4,380 KB
testcase_22 AC 347 ms
4,376 KB
testcase_23 AC 342 ms
4,380 KB
testcase_24 AC 344 ms
4,376 KB
testcase_25 AC 344 ms
4,376 KB
testcase_26 AC 343 ms
4,376 KB
testcase_27 AC 343 ms
4,380 KB
testcase_28 AC 343 ms
4,376 KB
testcase_29 AC 342 ms
4,380 KB
testcase_30 AC 343 ms
4,380 KB
testcase_31 AC 343 ms
4,376 KB
testcase_32 AC 344 ms
4,380 KB
testcase_33 AC 342 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

signed main(){
  ll N; cin >> N;
  ll ans1 = N - 1;
  for( int i = 0; 1LL * ( i + 1 ) * ( i + 1 ) * ( i + 1 ) <= N; ++i )    
    for( int j = i; 1LL * ( i + 1 ) * ( j + 1 ) * ( j + 1 ) <= N; ++j )
      if( N % ( 1LL * ( i + 1 ) * ( j + 1 ) ) == 0 )
        ans1 = min( ans1, i + j + N / ( 1LL * ( i + 1 ) * ( j + 1 ) ) - 1 );
  cout << ans1 << " " << N - 1 << endl;
  return 0;
}
0