結果
問題 | No.390 最長の数列 |
ユーザー | testestest |
提出日時 | 2016-07-17 17:49:06 |
言語 | C90 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 277 bytes |
コンパイル時間 | 234 ms |
コンパイル使用メモリ | 20,992 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-15 15:24:38 |
合計ジャッジ時間 | 1,155 ms |
ジャッジサーバーID (参考情報) |
judge3 / 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 | WA | - |
testcase_04 | AC | 4 ms
5,248 KB |
testcase_05 | WA | - |
testcase_06 | AC | 52 ms
6,016 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 3 ms
5,248 KB |
testcase_10 | AC | 35 ms
6,016 KB |
testcase_11 | AC | 35 ms
6,016 KB |
testcase_12 | AC | 35 ms
6,144 KB |
testcase_13 | WA | - |
testcase_14 | AC | 44 ms
5,248 KB |
testcase_15 | WA | - |
testcase_16 | AC | 2 ms
5,248 KB |
testcase_17 | AC | 5 ms
5,504 KB |
testcase_18 | AC | 5 ms
5,376 KB |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | a[100010],b[1000010],n,i,j,s; | ^ 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,s; | ^ main.c:2:22: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int] 2 | a[100010],b[1000010],n,i,j,s; | ^ main.c:2:24: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] 2 | a[100010],b[1000010],n,i,j,s; | ^ main.c:2:26: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int] 2 | a[100010],b[1000010],n,i,j,s; | ^ main.c:2:28: warning: type defaults to ‘int’ in declaration of ‘s’ [-Wimplicit-int] 2 | a[100010],b[1000010],n,i,j,s; | ^ 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(){ | ^~~~ main.c: In function ‘main’: 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: implici
ソースコード
#define max(p,q)(p>q?p:q) a[100010],b[1000010],n,i,j,s; c(int*a,int*b){return*b-*a;} main(){ 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); s=!printf("%d",s); }