# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1078579 |
2024-08-27T21:44:57 Z |
avighna |
Arcade (NOI20_arcade) |
C++17 |
|
1 ms |
344 KB |
#include <bits/stdc++.h>
typedef long long ll;
struct Point {
ll x, y;
void transform() {
ll u = y + x, v = y - x;
x = u, y = v;
}
};
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
ll n, m;
std::cin >> n >> m;
std::vector<Point> pts(m + 2);
std::vector<ll> t(m + 1), a(m + 1);
for (ll i = 1; i <= m; ++i) {
std::cin >> t[i];
pts[i].x = t[i];
}
for (ll i = 1; i <= m; ++i) {
std::cin >> a[i];
pts[i].y = a[i];
}
for (auto &i : pts) {
i.transform();
}
std::sort(pts.begin(), pts.end(), [](Point a, Point b) { return a.x < b.x; });
std::vector<ll> dp(m + 2, 1);
for (ll i = m; i >= 1; --i) {
for (ll j = i + 1; j <= m + 1; ++j) {
if (pts[j].x > pts[i].x and pts[j].y > pts[i].y) {
dp[i] = std::max(dp[i], dp[j] + 1);
}
}
}
std::cout << *std::max_element(dp.begin(), dp.end()) << '\n';
}
# |
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 |
- |