感觉毫无问题,然而WA
查看原帖
感觉毫无问题,然而WA
434015
Calanosay楼主2021/3/28 17:52
#include<bits/stdc++.h>
using namespace std;
int main(){
	int t;
	cin>>t;
	vector<int> a;
	while(t--){
		int x,q;
		cin>>x>>q;
		if(x==1){
			cout<<lower_bound(a.begin(),a.end(),q)-a.begin()+1<<endl;
		}
		if(x==2)	cout<<a[q-1]<<endl;
		if(x==3){
		if(a[0]<x)
		cout<<a[lower_bound(a.begin(),a.end(),q)-a.begin()-1]<<endl;
		else	cout<<-2147483647<<endl;
		}
		if(x==4){
		if(a[a.size()-1]>x)
		cout<<a[upper_bound(a.begin(),a.end(),q)-a.begin()]<<endl;
		else	cout<<2147483647<<endl;}
		if(x==5)	a.insert(lower_bound(a.begin(),a.end(),q),q);
	}
} 

多么美妙的做法,STL大法,然而我WA了。。。哪里出了问题

2021/3/28 17:52
加载中...