結果
問題 | No.326 あみだますたー |
ユーザー | %20 |
提出日時 | 2017-11-09 16:18:13 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 4 ms / 2,000 ms |
コード長 | 348 bytes |
コンパイル時間 | 1,163 ms |
コンパイル使用メモリ | 28,672 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 07:27:14 |
合計ジャッジ時間 | 1,197 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 1 ms
5,248 KB |
testcase_03 | AC | 4 ms
5,248 KB |
testcase_04 | AC | 2 ms
5,248 KB |
testcase_05 | AC | 1 ms
5,248 KB |
testcase_06 | AC | 2 ms
5,248 KB |
testcase_07 | AC | 1 ms
5,248 KB |
testcase_08 | AC | 2 ms
5,248 KB |
testcase_09 | AC | 3 ms
5,248 KB |
testcase_10 | AC | 4 ms
5,248 KB |
testcase_11 | AC | 1 ms
5,248 KB |
testcase_12 | AC | 2 ms
5,248 KB |
testcase_13 | AC | 3 ms
5,248 KB |
testcase_14 | AC | 1 ms
5,248 KB |
testcase_15 | AC | 2 ms
5,248 KB |
testcase_16 | AC | 1 ms
5,248 KB |
testcase_17 | AC | 1 ms
5,248 KB |
testcase_18 | AC | 2 ms
5,248 KB |
testcase_19 | AC | 1 ms
5,248 KB |
testcase_20 | AC | 1 ms
5,248 KB |
testcase_21 | AC | 0 ms
5,248 KB |
testcase_22 | AC | 2 ms
5,248 KB |
testcase_23 | AC | 2 ms
5,248 KB |
testcase_24 | AC | 3 ms
5,248 KB |
testcase_25 | AC | 2 ms
5,248 KB |
testcase_26 | AC | 1 ms
5,248 KB |
testcase_27 | AC | 2 ms
5,248 KB |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class 1 | *x,N,K,X['~~'],a[100],t,k,i,j; | ^ main.c:1:2: warning: type defaults to 'int' in declaration of 'x' [-Wimplicit-int] 1 | *x,N,K,X['~~'],a[100],t,k,i,j; | ^ main.c:1:4: warning: type defaults to 'int' in declaration of 'N' [-Wimplicit-int] 1 | *x,N,K,X['~~'],a[100],t,k,i,j; | ^ main.c:1:6: warning: type defaults to 'int' in declaration of 'K' [-Wimplicit-int] 1 | *x,N,K,X['~~'],a[100],t,k,i,j; | ^ main.c:1:10: warning: multi-character character constant [-Wmultichar] 1 | *x,N,K,X['~~'],a[100],t,k,i,j; | ^~~~ main.c:1:8: warning: type defaults to 'int' in declaration of 'X' [-Wimplicit-int] 1 | *x,N,K,X['~~'],a[100],t,k,i,j; | ^ main.c:1:16: warning: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] 1 | *x,N,K,X['~~'],a[100],t,k,i,j; | ^ main.c:1:23: warning: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 1 | *x,N,K,X['~~'],a[100],t,k,i,j; | ^ main.c:1:25: warning: type defaults to 'int' in declaration of 'k' [-Wimplicit-int] 1 | *x,N,K,X['~~'],a[100],t,k,i,j; | ^ main.c:1:27: warning: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] 1 | *x,N,K,X['~~'],a[100],t,k,i,j; | ^ main.c:1:29: warning: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] 1 | *x,N,K,X['~~'],a[100],t,k,i,j; | ^ main.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:3:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | scanf("%d%d",&N,&K); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | *x,N,K,X['~~'],a[100],t,k,i,j; main.c:3:
ソースコード
*x,N,K,X['~~'],a[100],t,k,i,j; main(){ scanf("%d%d",&N,&K); for(i=0;i<K;++i)scanf("%d%d",X+i,&t); x=X+K; for(i=0;i++<N;a[t-1]=i)scanf("%d",&t); for(i=0;i<N;++i){ t=a[i]; for(j=0;j<K+k;++j)t+=(t==X[j])-(t==X[j]+1); for(j=t;j<=i;)x[k++]=j++; for(j=t;--j>i;)x[k++]=j; } printf("%d ",k); for(i=0;i<k;++i)printf("%d %d ",x[i],x[i]+1); }