結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 63 ms
5,376 KB
testcase_03 AC 49 ms
5,376 KB
testcase_04 AC 461 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 8 ms
5,376 KB
testcase_09 AC 16 ms
5,376 KB
testcase_10 AC 11 ms
5,376 KB
testcase_11 AC 116 ms
5,376 KB
testcase_12 AC 62 ms
5,376 KB
testcase_13 AC 100 ms
5,376 KB
testcase_14 AC 142 ms
5,376 KB
testcase_15 AC 83 ms
5,376 KB
testcase_16 AC 13 ms
5,376 KB
testcase_17 AC 36 ms
5,376 KB
testcase_18 AC 94 ms
5,376 KB
testcase_19 AC 57 ms
5,376 KB
testcase_20 AC 123 ms
5,376 KB
testcase_21 AC 14 ms
5,376 KB
testcase_22 AC 92 ms
5,376 KB
testcase_23 AC 14 ms
5,376 KB
testcase_24 AC 18 ms
5,376 KB
testcase_25 AC 3 ms
5,376 KB
testcase_26 AC 15 ms
5,376 KB
testcase_27 AC 170 ms
5,376 KB
testcase_28 AC 100 ms
5,376 KB
testcase_29 AC 273 ms
5,376 KB
testcase_30 AC 159 ms
5,376 KB
testcase_31 AC 80 ms
5,376 KB
testcase_32 AC 31 ms
5,376 KB
testcase_33 AC 1 ms
5,376 KB
testcase_34 AC 51 ms
5,376 KB
testcase_35 AC 221 ms
5,376 KB
testcase_36 AC 101 ms
5,376 KB
testcase_37 AC 100 ms
5,376 KB
testcase_38 AC 234 ms
5,376 KB
testcase_39 AC 69 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:5:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    5 | main(){
      | ^~~~
main.c: In function ‘main’:
main.c:6:1: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    6 | scanf("%lld",&m);
      | ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | long long m,n,s,
main.c:6:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    6 | scanf("%lld",&m);
      | ^~~~~
main.c:6:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:8:3: warning: implicit declaration of function ‘pow’ [-Wimplicit-function-declaration]
    8 | i=pow(m,1/3.)+2;
      |   ^~~
main.c:1:1: note: include ‘<math.h>’ or provide a declaration of ‘pow’
  +++ |+#include <math.h>
    1 | long long m,n,s,
main.c:8:3: warning: incompatible implicit declaration of built-in function ‘pow’ [-Wbuiltin-declaration-mismatch]
    8 | i=pow(m,1/3.)+2;
      |   ^~~
main.c:8:3: note: include ‘<math.h>’ or provide a declaration of ‘pow’
main.c:12:3: warning: implicit declaration of function ‘sqrt’ [-Wimplicit-function-declaration]
   12 | j=sqrt(n)+2;
      |   ^~~~
main.c:12:3: note: include ‘<math.h>’ or provide a declaration of ‘sqrt’
main.c:12:3: warning: incompatible implicit declaration of built-in function ‘sqrt’ [-Wbuiltin-declaration-mismatch]
main.c:12:3: note: include ‘<math.h>’ or provide a declaration of ‘sqrt’
main.c:16:4: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
   16 | s=!printf("%lld %lld",s,m-1);
      |    ^~~~~~
main.c:16:4: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
main.c:16:4: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
main.c:16:4: note: include ‘<stdio.h>’ or provide a declar

ソースコード

diff #

long long m,n,s,
a,b,c,
i,j,k;
#define min(p,q)(p<q?p:q)
main(){
scanf("%lld",&m);
s=m;
i=pow(m,1/3.)+2;
for(;--i>0;){
if(m%i!=0)continue;
n=m/i;
j=sqrt(n)+2;
while(n%--j);
s=min(s,i+j+n/j-3);
}
s=!printf("%lld %lld",s,m-1);
}
0