11991
Easy Problem from Rujia Liu?
Though Rujia Liu usually sets hard problems for contests (for example, regional0
/*
Author:2486
Memory: 0 KB Time: 123 MS
Language: C++ 4.8.2 Result: Accepted
*/
//通过中的stringstream进行字符串处理
#include
#include
#include
#include
#include
using namespace std;
const int maxn=100000+5;
struct ins {
int id,val;
ins(int val,int id):id(id),val(val) {}
bool operator < (const ins & a)const {
if(val!=a.val)
return valbuf;
int k,v,n,m;
int main() {
#ifndef ONLINE_JUDGE
freopen("D:imput.txt","r",stdin);
#endif // ONLINE_JUDGE
while(~scanf("%d%d",&n,&m)) {
int val;
buf.clear();
for(int i=0; i::iterator buf1=lower_bound(buf.begin(),buf.end(),s);
if(buf1!=buf.end()&&buf1->val==v&&k!=0) {
buf1+=(k-1);
if(buf1->val==v)
printf("%d\n",buf1->id);
else printf("0\n");
} else printf("0\n");
}
}
return 0;
}