This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main () {
int q;
cin >> q;
vector<int> a;
while(q--){
int j, v;
cin >> j >> v;
a.insert(a.begin()+j-1, v);
multiset<int> s;
for(int i:a) {
s.insert(i);
auto it = s.lower_bound(i);
it++;
if(it != s.end()) {
s.erase(it);
}
}
cout << s.size() << "\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |