這是我的#include
using namespace std;
int main(){string s;int n,top;vector v = {0};top = 0;while (cin >> s){if (s == "END"){break;}cin >> n;if (s == "GIVE"){for (int i=0;i{if (n > v[i]){v.insert(v.begin()+i,n);break;}}}else if (s == "FIND"){cout << v[n-1] << endl;}}return 0;}
1. io加速
2. 二分搜