# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
892510 |
2023-12-25T12:56:00 Z |
adaawf |
Arcade (NOI20_arcade) |
C++14 |
|
1 ms |
344 KB |
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
struct PUS {
long long int x, y;
} a[500005];
bool cmp(PUS aa, PUS bb) {
if (aa.x + aa.y == bb.x + bb.y) return aa.x - aa.y < bb.x - bb.y;
return aa.x + aa.y < bb.x + bb.y;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
long long int n, m;
cin >> n >> m;
for (int i = 1; i <= m; i++) {
cin >> a[i].x;
}
for (int i = 1; i <= m; i++) {
cin >> a[i].y;
}
sort(a + 1, a + m + 1, cmp);
multiset<long long int> s;
for (int i = 1; i <= n; i++) {
auto h = s.upper_bound(a[i].x - a[i].y);
if (h != s.begin()) {
s.erase(prev(h));
}
s.insert(a[i].x - a[i].y);
}
cout << s.size();
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |