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