結果
問題 | No.390 最長の数列 |
ユーザー | testestest |
提出日時 | 2016-07-08 23:50:52 |
言語 | C90 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 295 bytes |
コンパイル時間 | 496 ms |
コンパイル使用メモリ | 20,480 KB |
実行使用メモリ | 7,296 KB |
最終ジャッジ日時 | 2024-10-13 07:35:31 |
合計ジャッジ時間 | 6,902 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 0 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,248 KB |
testcase_03 | AC | 0 ms
5,248 KB |
testcase_04 | AC | 0 ms
5,248 KB |
testcase_05 | TLE | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | a[100010]; | ^ main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int] main.c:3:1: warning: data definition has no type or storage class 3 | d[100010]; | ^ main.c:3:1: warning: type defaults to ‘int’ in declaration of ‘d’ [-Wimplicit-int] main.c:4:1: warning: data definition has no type or storage class 4 | n,i,j,s; | ^ main.c:4:1: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int] main.c:4:3: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] 4 | n,i,j,s; | ^ main.c:4:5: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int] 4 | n,i,j,s; | ^ main.c:4:7: warning: type defaults to ‘int’ in declaration of ‘s’ [-Wimplicit-int] 4 | n,i,j,s; | ^ main.c:5:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 5 | c(int*a,int*b){return*a-*b;} | ^ main.c: In function ‘main’: main.c:7:13: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 7 | for(scanf("%d",&n);~scanf("%d",a+i);i++); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | #define max(p,q)(p>q?p:q) main.c:7:13: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 7 | for(scanf("%d",&n);~scanf("%d",a+i);i++); | ^~~~~ main.c:7:13: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:8:9: warning: implicit declaration of function ‘qsort’ [-Wimplicit-function-declaration] 8 | qsort(a,n,4,c); | ^~~~~ main.c:12:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 12 | printf("%d",s); | ^~~~~~
ソースコード
#define max(p,q)(p>q?p:q) a[100010]; d[100010]; n,i,j,s; c(int*a,int*b){return*a-*b;} int main(){ for(scanf("%d",&n);~scanf("%d",a+i);i++); qsort(a,n,4,c); d[--i]=1; for(;i--;)for(j=n;--j>i;)if(a[j]%a[i]==0)d[i]=max(d[i],d[j]+1); for(i=0;i<n;i++)s=max(s,d[i]); printf("%d",s); return 0; }