結果

問題 No.376 立方体のN等分 (2)
ユーザー 👑 testestesttestestest
提出日時 2016-06-04 23:13:52
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 478 ms / 5,000 ms
コード長 155 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 21,504 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-26 03:09:58
合計ジャッジ時間 4,696 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 65 ms
6,944 KB
testcase_03 AC 51 ms
6,944 KB
testcase_04 AC 478 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 9 ms
6,944 KB
testcase_09 AC 16 ms
6,940 KB
testcase_10 AC 11 ms
6,944 KB
testcase_11 AC 121 ms
6,940 KB
testcase_12 AC 66 ms
6,944 KB
testcase_13 AC 105 ms
6,944 KB
testcase_14 AC 148 ms
6,944 KB
testcase_15 AC 87 ms
6,940 KB
testcase_16 AC 14 ms
6,944 KB
testcase_17 AC 38 ms
6,940 KB
testcase_18 AC 99 ms
6,944 KB
testcase_19 AC 59 ms
6,940 KB
testcase_20 AC 129 ms
6,944 KB
testcase_21 AC 15 ms
6,940 KB
testcase_22 AC 97 ms
6,944 KB
testcase_23 AC 15 ms
6,940 KB
testcase_24 AC 20 ms
6,944 KB
testcase_25 AC 4 ms
6,944 KB
testcase_26 AC 16 ms
6,940 KB
testcase_27 AC 177 ms
6,940 KB
testcase_28 AC 106 ms
6,944 KB
testcase_29 AC 285 ms
6,944 KB
testcase_30 AC 167 ms
6,948 KB
testcase_31 AC 84 ms
6,940 KB
testcase_32 AC 33 ms
6,940 KB
testcase_33 AC 2 ms
6,944 KB
testcase_34 AC 54 ms
6,944 KB
testcase_35 AC 229 ms
6,940 KB
testcase_36 AC 106 ms
6,944 KB
testcase_37 AC 105 ms
6,944 KB
testcase_38 AC 246 ms
6,940 KB
testcase_39 AC 73 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:2:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function ‘main’:
main.c:3:1: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    3 | scanf("%ld",&m);
      | ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | long m,s,i,j;
main.c:3:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    3 | scanf("%ld",&m);
      | ^~~~~
main.c:3:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:4:7: warning: implicit declaration of function ‘cbrt’ [-Wimplicit-function-declaration]
    4 | for(i=cbrt(s=m)+1;--i;s=m%i|(j=i+j+m/i/j-3)>s?s:j)
      |       ^~~~
main.c:1:1: note: include ‘<math.h>’ or provide a declaration of ‘cbrt’
  +++ |+#include <math.h>
    1 | long m,s,i,j;
main.c:4:7: warning: incompatible implicit declaration of built-in function ‘cbrt’ [-Wbuiltin-declaration-mismatch]
    4 | for(i=cbrt(s=m)+1;--i;s=m%i|(j=i+j+m/i/j-3)>s?s:j)
      |       ^~~~
main.c:4:7: note: include ‘<math.h>’ or provide a declaration of ‘cbrt’
main.c:5:7: warning: implicit declaration of function ‘sqrt’ [-Wimplicit-function-declaration]
    5 | for(j=sqrt(m/i)+1;m%i<1&&m/i%--j;);
      |       ^~~~
main.c:5:7: note: include ‘<math.h>’ or provide a declaration of ‘sqrt’
main.c:5:7: warning: incompatible implicit declaration of built-in function ‘sqrt’ [-Wbuiltin-declaration-mismatch]
main.c:5:7: note: include ‘<math.h>’ or provide a declaration of ‘sqrt’
main.c:6:4: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
    6 | s=!printf("%ld %ld",s,m-1);
      |    ^~~~~~
main.c:6:4: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:6:4: warning: incompatible implicit declaration of built-in function ‘printf’ [-W

ソースコード

diff #

long m,s,i,j;
main(){
scanf("%ld",&m);
for(i=cbrt(s=m)+1;--i;s=m%i|(j=i+j+m/i/j-3)>s?s:j)
for(j=sqrt(m/i)+1;m%i<1&&m/i%--j;);
s=!printf("%ld %ld",s,m-1);
}
0