結果

問題 No.376 立方体のN等分 (2)
ユーザー CleyLCleyL
提出日時 2023-11-06 22:52:03
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 359 bytes
コンパイル時間 737 ms
コンパイル使用メモリ 68,308 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-11-06 22:52:40
合計ジャッジ時間 36,270 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 453 ms
4,348 KB
testcase_03 AC 856 ms
4,348 KB
testcase_04 AC 615 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 14 ms
4,348 KB
testcase_09 AC 57 ms
4,348 KB
testcase_10 AC 679 ms
4,348 KB
testcase_11 AC 170 ms
4,348 KB
testcase_12 AC 370 ms
4,348 KB
testcase_13 AC 181 ms
4,348 KB
testcase_14 AC 223 ms
4,348 KB
testcase_15 AC 168 ms
4,348 KB
testcase_16 AC 4,315 ms
4,348 KB
testcase_17 AC 391 ms
4,348 KB
testcase_18 AC 191 ms
4,348 KB
testcase_19 AC 733 ms
4,348 KB
testcase_20 AC 228 ms
4,348 KB
testcase_21 AC 4,799 ms
4,348 KB
testcase_22 AC 206 ms
4,348 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 211 ms
4,348 KB
testcase_26 TLE -
testcase_27 AC 286 ms
4,348 KB
testcase_28 AC 212 ms
4,348 KB
testcase_29 AC 397 ms
4,348 KB
testcase_30 AC 292 ms
4,348 KB
testcase_31 AC 212 ms
4,348 KB
testcase_32 AC 288 ms
4,348 KB
testcase_33 AC 212 ms
4,348 KB
testcase_34 AC 212 ms
4,348 KB
testcase_35 AC 341 ms
4,348 KB
testcase_36 AC 213 ms
4,348 KB
testcase_37 AC 212 ms
4,348 KB
testcase_38 AC 357 ms
4,348 KB
testcase_39 AC 390 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
  long long n;cin>>n;
  long long ans = n-1;
  for(long long i = 1; n >= i*i; i++){
    if(n%i == 0){
      long long m = n/i;
      for(long long j = i; m >= j*j; j++){
        if(m%j == 0){
          ans = min(ans, (i-1)+(j-1)+(m/j-1));
        }
      }
    }
  }
  cout << ans << " " << n-1 << endl;
}
0