結果

問題 No.8016 unordered_mapなるたけ落とすマン
ユーザー 👑 testestest
提出日時 2016-05-22 00:35:38
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 292 bytes
コンパイル時間 575 ms
コンパイル使用メモリ 20,608 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-10-07 05:32:08
合計ジャッジ時間 5,858 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other WA * 18 TLE * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
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,4,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