結果
問題 | No.8009 異なる数字の最大の範囲(勉強会用) |
ユーザー | ciel |
提出日時 | 2015-03-24 03:13:43 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 17 ms / 5,000 ms |
コード長 | 169 bytes |
コンパイル時間 | 255 ms |
コンパイル使用メモリ | 20,352 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-20 15:00:07 |
合計ジャッジ時間 | 1,227 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,816 KB |
testcase_01 | AC | 1 ms
6,816 KB |
testcase_02 | AC | 0 ms
6,816 KB |
testcase_03 | AC | 1 ms
6,820 KB |
testcase_04 | AC | 0 ms
6,816 KB |
testcase_05 | AC | 0 ms
6,820 KB |
testcase_06 | AC | 1 ms
6,816 KB |
testcase_07 | AC | 1 ms
6,820 KB |
testcase_08 | AC | 1 ms
6,820 KB |
testcase_09 | AC | 1 ms
6,820 KB |
testcase_10 | AC | 1 ms
6,816 KB |
testcase_11 | AC | 1 ms
6,816 KB |
testcase_12 | AC | 1 ms
6,820 KB |
testcase_13 | AC | 1 ms
6,820 KB |
testcase_14 | AC | 1 ms
6,816 KB |
testcase_15 | AC | 13 ms
6,816 KB |
testcase_16 | AC | 12 ms
6,816 KB |
testcase_17 | AC | 12 ms
6,820 KB |
testcase_18 | AC | 17 ms
6,820 KB |
testcase_19 | AC | 13 ms
6,820 KB |
testcase_20 | AC | 9 ms
6,820 KB |
testcase_21 | AC | 7 ms
6,816 KB |
testcase_22 | AC | 11 ms
6,820 KB |
testcase_23 | AC | 8 ms
6,816 KB |
testcase_24 | AC | 12 ms
6,816 KB |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | a[100000],v[1000001],i,j=-1,r,n;main(){ | ^ main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int] main.c:1:11: warning: type defaults to ‘int’ in declaration of ‘v’ [-Wimplicit-int] 1 | a[100000],v[1000001],i,j=-1,r,n;main(){ | ^ main.c:1:22: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] 1 | a[100000],v[1000001],i,j=-1,r,n;main(){ | ^ main.c:1:24: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int] 1 | a[100000],v[1000001],i,j=-1,r,n;main(){ | ^ main.c:1:29: warning: type defaults to ‘int’ in declaration of ‘r’ [-Wimplicit-int] 1 | a[100000],v[1000001],i,j=-1,r,n;main(){ | ^ main.c:1:31: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int] 1 | a[100000],v[1000001],i,j=-1,r,n;main(){ | ^ main.c:1:33: warning: return type defaults to ‘int’ [-Wimplicit-int] 1 | a[100000],v[1000001],i,j=-1,r,n;main(){ | ^~~~ main.c: In function ‘main’: main.c:2:13: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 2 | for(scanf("%d",&n);i<n;i++)scanf("%d",a+i); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | a[100000],v[1000001],i,j=-1,r,n;main(){ main.c:2:13: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 2 | for(scanf("%d",&n);i<n;i++)scanf("%d",a+i); | ^~~~~ main.c:2:13: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:4:9: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-de
ソースコード
a[100000],v[1000001],i,j=-1,r,n;main(){ for(scanf("%d",&n);i<n;i++)scanf("%d",a+i); for(i=0;i<n;r=r>i-j?r:i-j,v[a[i++]]++)for(;v[a[i]];)v[a[++j]]--; printf("%d",r); }