結果

問題 No.3016 unordered_mapなるたけ落とすマン
ユーザー testestesttestestest
提出日時 2016-05-22 00:35:49
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 292 bytes
コンパイル時間 843 ms
コンパイル使用メモリ 20,352 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-16 11:41:17
合計ジャッジ時間 6,404 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,832 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | n,m,i,j,s;
      | ^
main.c:1:1: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int]
main.c:1:3: warning: type defaults to ‘int’ in declaration of ‘m’ [-Wimplicit-int]
    1 | n,m,i,j,s;
      |   ^
main.c:1:5: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
    1 | n,m,i,j,s;
      |     ^
main.c:1:7: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int]
    1 | n,m,i,j,s;
      |       ^
main.c:1:9: warning: type defaults to ‘int’ in declaration of ‘s’ [-Wimplicit-int]
    1 | n,m,i,j,s;
      |         ^
main.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
    3 | c(long*a,long*b){return*a-*b;}
      | ^
main.c: In function ‘main’:
main.c:5:1: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
    5 | scanf("%d%d",&n,&m);
      | ^~~~~
main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
  +++ |+#include <stdio.h>
    1 | n,m,i,j,s;
main.c:5:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    5 | scanf("%d%d",&n,&m);
      | ^~~~~
main.c:5:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’
main.c:6:25: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long int *’ [-Wformat=]
    6 | for(i=0;i<n;i++)scanf("%d",a+i);
      |                        ~^  ~~~
      |                         |   |
      |                         |   long int *
      |                         int *
      |                        %ld
main.c:7:25: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long int *’ [-Wformat=]
    7 | for(i=0;i<m;i++)scanf("%d",b+i);
      |                        ~^  ~~~
      |                         |   |
      |                       

ソースコード

diff #

n,m,i,j,s;
long a[100010],b[100010];
c(long*a,long*b){return*a-*b;}
int main(){
scanf("%d%d",&n,&m);
for(i=0;i<n;i++)scanf("%d",a+i);
for(i=0;i<m;i++)scanf("%d",b+i);
qsort(a,n,8,c);
for(i=0;i<m;i++){
j=s=0;
while(j<n&&a[j]<b[i])j++;
while(a[j]==b[i]){j++;s++;}
printf("%d ",s);
}
return 0;
}
0