結果
| 問題 |
No.8016 unordered_mapなるたけ落とすマン
|
| ユーザー |
👑 testestest
|
| 提出日時 | 2016-05-22 00:35:49 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 292 bytes |
| コンパイル時間 | 781 ms |
| コンパイル使用メモリ | 20,480 KB |
| 実行使用メモリ | 13,632 KB |
| 最終ジャッジ日時 | 2024-10-07 05:34:23 |
| 合計ジャッジ時間 | 6,209 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | WA * 12 TLE * 1 -- * 35 |
コンパイルメッセージ
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);
| ~^ ~~~
| | |
|
ソースコード
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;
}
testestest