結果
問題 | No.375 立方体のN等分 (1) |
ユーザー | Grun1396 |
提出日時 | 2017-02-25 16:39:07 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 115 ms / 5,000 ms |
コード長 | 260 bytes |
コンパイル時間 | 99 ms |
コンパイル使用メモリ | 21,632 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 03:14:44 |
合計ジャッジ時間 | 1,708 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 24 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 3 ms
5,376 KB |
testcase_08 | AC | 15 ms
5,376 KB |
testcase_09 | AC | 3 ms
5,376 KB |
testcase_10 | AC | 7 ms
5,376 KB |
testcase_11 | AC | 6 ms
5,376 KB |
testcase_12 | AC | 7 ms
5,376 KB |
testcase_13 | AC | 7 ms
5,376 KB |
testcase_14 | AC | 53 ms
5,376 KB |
testcase_15 | AC | 11 ms
5,376 KB |
testcase_16 | AC | 7 ms
5,376 KB |
testcase_17 | AC | 87 ms
5,376 KB |
testcase_18 | AC | 58 ms
5,376 KB |
testcase_19 | AC | 10 ms
5,376 KB |
testcase_20 | AC | 5 ms
5,376 KB |
testcase_21 | AC | 4 ms
5,376 KB |
testcase_22 | AC | 115 ms
5,376 KB |
testcase_23 | AC | 7 ms
5,376 KB |
testcase_24 | AC | 4 ms
5,376 KB |
testcase_25 | AC | 20 ms
5,376 KB |
testcase_26 | AC | 6 ms
5,376 KB |
testcase_27 | AC | 10 ms
5,376 KB |
testcase_28 | AC | 4 ms
5,376 KB |
testcase_29 | AC | 3 ms
5,376 KB |
testcase_30 | AC | 6 ms
5,376 KB |
testcase_31 | AC | 8 ms
5,376 KB |
testcase_32 | AC | 4 ms
5,376 KB |
testcase_33 | AC | 8 ms
5,376 KB |
コンパイルメッセージ
main.c: In function ‘main’: main.c:4:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 4 | scanf("%ld",&n); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | int main(){ main.c:4:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 4 | scanf("%ld",&n); | ^~~~~ main.c:4:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:7:15: warning: implicit declaration of function ‘cbrt’ [-Wimplicit-function-declaration] 7 | for(i=cbrt(n)+1;i>0;i--){ | ^~~~ main.c:1:1: note: include ‘<math.h>’ or provide a declaration of ‘cbrt’ +++ |+#include <math.h> 1 | int main(){ main.c:7:15: warning: incompatible implicit declaration of built-in function ‘cbrt’ [-Wbuiltin-declaration-mismatch] 7 | for(i=cbrt(n)+1;i>0;i--){ | ^~~~ main.c:7:15: note: include ‘<math.h>’ or provide a declaration of ‘cbrt’ main.c:9:23: warning: implicit declaration of function ‘sqrt’ [-Wimplicit-function-declaration] 9 | for(j=sqrt(n/i)+1;j>0;j--){ | ^~~~ main.c:9:23: note: include ‘<math.h>’ or provide a declaration of ‘sqrt’ main.c:9:23: warning: incompatible implicit declaration of built-in function ‘sqrt’ [-Wbuiltin-declaration-mismatch] main.c:9:23: note: include ‘<math.h>’ or provide a declaration of ‘sqrt’ main.c:15:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 15 | printf("%ld %ld",s,n-1); | ^~~~~~ main.c:15:9: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:15:9: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:15:9: note
ソースコード
int main(){ long n,s,t; int i,j; scanf("%ld",&n); s=n; //自明な上界 for(i=cbrt(n)+1;i>0;i--){ if(n%i!=0)continue; for(j=sqrt(n/i)+1;j>0;j--){ if(n/i%j!=0)continue; t=i+j+n/i/j-3; if(t<s)s=t; } } printf("%ld %ld",s,n-1); return 0; }