# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
341859 |
2020-12-31T09:36:12 Z |
haboh |
Money (IZhO17_money) |
C++14 |
|
1 ms |
364 KB |
#include <iostream>
#include <set>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
vector <int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
multiset<int>act;
for (int i = 0; i < n; i++) {
auto it = act.upper_bound(a[i]);
if(it == act.begin()) {
act.insert(a[i]);
} else {
it--;
act.erase(it);
act.insert(a[i]);
}
}
cout << act.size() << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |