結果

問題 No.376 立方体のN等分 (2)
ユーザー mudbdbmudbdb
提出日時 2016-06-05 16:12:19
言語 C90
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 472 bytes
コンパイル時間 162 ms
コンパイル使用メモリ 20,736 KB
実行使用メモリ 14,008 KB
最終ジャッジ日時 2024-04-17 04:55:48
合計ジャッジ時間 33,643 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 354 ms
6,944 KB
testcase_03 AC 769 ms
6,944 KB
testcase_04 AC 494 ms
6,940 KB
testcase_05 AC 0 ms
6,944 KB
testcase_06 AC 0 ms
6,940 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 9 ms
6,940 KB
testcase_09 AC 34 ms
6,940 KB
testcase_10 AC 748 ms
6,940 KB
testcase_11 AC 120 ms
6,940 KB
testcase_12 AC 303 ms
6,944 KB
testcase_13 AC 114 ms
6,940 KB
testcase_14 AC 147 ms
6,940 KB
testcase_15 AC 85 ms
6,944 KB
testcase_16 AC 4,945 ms
6,944 KB
testcase_17 AC 293 ms
6,940 KB
testcase_18 AC 96 ms
6,944 KB
testcase_19 AC 598 ms
6,944 KB
testcase_20 AC 128 ms
6,940 KB
testcase_21 TLE -
testcase_22 AC 103 ms
6,940 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 AC 104 ms
6,940 KB
testcase_26 TLE -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |   scanf("%lld", &N);
      |   ^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main()
{
  long long N;
  scanf("%lld", &N);
  long long N2;
  long long a,b,c;
  long long min = N-1;
  for (a=2; a*a<=N; a++) {
    if (N%a == 0) {
      N2 = N/a;
      c = 0;
      for (b=2; b*b<=N2; b++) {
        if (N2%b == 0) {
          c = N2/b;
          if (min > (a+b+c-3)) min = a+b+c-3;
        }
      }
      if (c == 0) {
        if (min > (a+N2-2)) min = a+N2-2;
      }
    }
  }
  printf("%lld %lld\n", min, N-1);
  return 0;
}
0