当前位置:网站首页>uva11991
uva11991
2022-06-21 12:38:00 【Stabbing the bear with a knife】
#include <iostream>
#include <istream>
#include <sstream>
#include <vector>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <chrono>
#include <ctime>
#include <cmath>
#include <cctype>
#include <string>
#include <cstdio>
#include <iomanip>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <functional>
#include <iterator>
using namespace std;
int n, m,input,a,b;
int main()
{
unordered_map<int, vector<int>> mmp;
while (cin >> n >> m) {
mmp.clear();
for (int i = 0; i < n; i++) {
cin >> input;
mmp[input].push_back(i+1);
}
for (int i = 0; i < m; i++) {
cin >> a >> b;
a--;
if (a < 0 ||mmp.count(b) == 0 || a >= mmp[b].size()) cout << 0 << endl;
else cout << mmp[b][a] << endl;
}
}
return 0;
}
边栏推荐
- Uniapp wechat applet obtains location authorization
- 计算距离的几种方式汇总
- Educoder web exercises - interactive elements
- Educoder web exercises -- text level semantic elements
- Association condition of SQL left connection
- [100 unity step pit knowledge points] | collision box detection physics in unity OverlapBox、OverlapCaps
- 子网掩码计算
- Educoder Web练习题---对表单元素分组
- Phpstudy2018 installation and opening directory browsing
- UVA1203 Argus
猜你喜欢

cartographer_ceres_scan_matcher_2d

Redis-bitmap 位图

phpstudy2018安装及打开目录浏览

Introduction to CPU, MPU, MCU, SOC and MCM

Phpstudy2018 installation and opening directory browsing

Simple factory vs Factory Method & handwritten automatic chemical factory - system learning 6

简单工厂VS工厂方法&手写自动化工厂——系统学习六

最新远程部署运维工具汇总

i. MX - rt1052 boot start

在数字时代实现IT敏捷性的12个技巧
随机推荐
一文掌握SQLite3基本用法
Educoder Web练习题---分组元素
i. MX - rt1052 sdcard operation (SDIO interface)
uva11300
Graveyard
PWM (pulse width modulation) of STM32 notes
typescript localStorage 封装
常用的17个运维监控系统
Typescript localstorage encapsulation
Uniapp wechat applet obtains location authorization
UML的六种关系-系统学习四
About SDRAM memory
Educoder Web练习题---创建下拉列表
Embedded struct and embedded interface
phpstudy2018安装及打开目录浏览
Nine trends and priorities that CIOs need to focus on in 2022
[100 unity practical skills] | obtain the coordinates of mouse clicks in the game and move the game object to the click position of the mouse
Redis里5种基本数据类型常用指令
3. 运算符
子网掩码计算