# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
853289 |
2023-09-24T01:26:51 Z |
NeroZein |
Money (IZhO17_money) |
C++17 |
|
0 ms |
344 KB |
#include "bits/stdc++.h"
using namespace std;
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<int> lds;
for (int i = 0; i < n; ++i) {
int x;
cin >> x;
int ind = upper_bound(lds.begin(), lds.end(), -x) - lds.begin();
if (ind == (int) lds.size()) {
lds.push_back(-x);
} else {
lds[ind] = -x;
}
}
cout << lds.size() << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |