結果

問題 No.8016 unordered_mapなるたけ落とすマン
ユーザー 西尾
提出日時 2018-03-07 14:04:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 242 ms / 1,000 ms
コード長 492 bytes
コンパイル時間 1,767 ms
コンパイル使用メモリ 173,260 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-01 21:15:07
合計ジャッジ時間 14,851 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 48
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
int i;
int N;
int M;
long long B;

	cin >> N;
	cin >> M;

vector<long long> A( N );
pair<vector<long long>::iterator,
		vector<long long>::iterator> it;

	for( i = 0; i < N; i++ ) cin >> A[ i ];

	sort( A.begin(), A.end() );

	for( i = 0; i < M; i++ )
	{
		cin >> B;
		it = equal_range( A.begin(), A.end(), B );
		cout << (int)( it.second - it.first );
		
		if( i == M - 1 )
			cout << endl;
		else
			cout << " ";
	}

	return 0;
}
0