結果
問題 | No.375 立方体のN等分 (1) |
ユーザー | testestest |
提出日時 | 2016-06-04 22:30:33 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 1,225 ms / 5,000 ms |
コード長 | 227 bytes |
コンパイル時間 | 207 ms |
コンパイル使用メモリ | 21,376 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-26 03:09:53 |
合計ジャッジ時間 | 4,271 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,812 KB |
testcase_01 | AC | 1 ms
6,940 KB |
testcase_02 | AC | 68 ms
6,940 KB |
testcase_03 | AC | 1 ms
6,944 KB |
testcase_04 | AC | 1 ms
6,944 KB |
testcase_05 | AC | 1 ms
6,940 KB |
testcase_06 | AC | 1 ms
6,944 KB |
testcase_07 | AC | 3 ms
6,944 KB |
testcase_08 | AC | 83 ms
6,940 KB |
testcase_09 | AC | 2 ms
6,940 KB |
testcase_10 | AC | 7 ms
6,944 KB |
testcase_11 | AC | 3 ms
6,944 KB |
testcase_12 | AC | 3 ms
6,940 KB |
testcase_13 | AC | 3 ms
6,940 KB |
testcase_14 | AC | 301 ms
6,944 KB |
testcase_15 | AC | 9 ms
6,944 KB |
testcase_16 | AC | 6 ms
6,944 KB |
testcase_17 | AC | 820 ms
6,940 KB |
testcase_18 | AC | 317 ms
6,944 KB |
testcase_19 | AC | 4 ms
6,940 KB |
testcase_20 | AC | 4 ms
6,940 KB |
testcase_21 | AC | 7 ms
6,940 KB |
testcase_22 | AC | 1,225 ms
6,940 KB |
testcase_23 | AC | 4 ms
6,944 KB |
testcase_24 | AC | 4 ms
6,944 KB |
testcase_25 | AC | 64 ms
6,940 KB |
testcase_26 | AC | 6 ms
6,940 KB |
testcase_27 | AC | 4 ms
6,940 KB |
testcase_28 | AC | 6 ms
6,940 KB |
testcase_29 | AC | 7 ms
6,944 KB |
testcase_30 | AC | 4 ms
6,944 KB |
testcase_31 | AC | 4 ms
6,940 KB |
testcase_32 | AC | 4 ms
6,940 KB |
testcase_33 | AC | 7 ms
6,940 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("%ld",&m); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | long m,n,s, main.c:6:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 6 | scanf("%ld",&m); | ^~~~~ main.c:6:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:8:3: warning: implicit declaration of function ‘sqrt’ [-Wimplicit-function-declaration] 8 | i=sqrt(m)+2; | ^~~~ main.c:1:1: note: include ‘<math.h>’ or provide a declaration of ‘sqrt’ +++ |+#include <math.h> 1 | long m,n,s, main.c:8:3: warning: incompatible implicit declaration of built-in function ‘sqrt’ [-Wbuiltin-declaration-mismatch] 8 | i=sqrt(m)+2; | ^~~~ main.c:8:3: note: include ‘<math.h>’ or provide a declaration of ‘sqrt’ main.c:17:4: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 17 | s=!printf("%ld %ld",s,m-1); | ^~~~~~ main.c:17:4: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:17:4: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch] main.c:17:4: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’
ソースコード
long m,n,s, a,b,c, i,j,k; #define min(p,q)(p<q?p:q) main(){ scanf("%ld",&m); s=m; i=sqrt(m)+2; for(;--i>0;){ if(m%i!=0)continue; n=m/i; for(j=i;j>0;j--){ if(n%j!=0)continue; s=min(s,i+j+n/j-3); } } s=!printf("%ld %ld",s,m-1); }