#include<iostream>
#include <map>
#include <vector>
using namespace std;
map<int , vector<int> >maper ;
int main()
{
int n , m , x;
int v , k ;
cin >> n >> m ;
maper.clear();
for(int i = 0; i < n; i ++)
{
cin >> x ;
if(!maper.count(x) )
maper[x] = vector<int>();
maper[x].push_back(i);
}
for(int i = 0; i < m; i ++){
cin >> k >> v ;
if(!maper.count(v) || maper[v].size() < k) cout << 0 << endl ;
else
cout << maper[v][k-1] << endl ;
}
cout << "hello word" << endl;
return 0 ;
}
Uva 11991
最新推荐文章于 2017-04-07 12:57:12 发布