結果

問題 No.8016 unordered_mapなるたけ落とすマン
ユーザー testestest
提出日時 2016-05-22 00:35:49
言語 C90
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 292 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 355 ms
コンパイル使用メモリ 29,260 KB
最終ジャッジ日時 2026-02-23 21:20:34
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other WA * 11 TLE * 2 -- * 35
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
    1 | n,m,i,j,s;
      | ^
main.c: In function ‘main’:
main.c:5:1: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch]
    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: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);
      |                        ~^  ~~~
      |                         |   |
      |                         |   long int *
      |                         int *
      |                        %ld
main.c:13:1: warning: incompatible implicit declaration of built-in function ‘printf’ [-Wbuiltin-declaration-mismatch]
   13 | printf("%d ",s);
      | ^~~~~~
main.c:13:1: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

ソースコード

diff #
raw source code

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