| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 391656 | maomao90 | Arcade (NOI20_arcade) | C++14 | 234 ms | 16556 KiB |
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;
#define mnto(x, y) x = min(x, (__typeof__(x)) y)
#define mxto(x, y) x = max(x, (__typeof__(x)) y)
#define REP(i, s, e) for (int i = s; i < e; i++)
#define RREP(i, s, e) for (int i = s; i >= e; i--)
typedef long long ll;
typedef long double ld;
#define MP make_pair
#define FI first
#define SE second
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
#define MT make_tuple
typedef tuple<int, int, int> iii;
#define ALL(_a) _a.begin(), _a.end()
#define pb emplace_back
typedef vector<int> vi;
typedef vector<ii> vii;
#define INF 1000000005
#define LINF 1000000000000000005
#define MOD 1000000007
#define MAXN 500005
int n, m;
ii ta[MAXN], xy[MAXN];
vi lis;
int main() {
scanf("%d%d", &n, &m);
REP (i, 0, m) {
scanf("%d", &ta[i].FI);
}
REP (i, 0, m) {
scanf("%d", &ta[i].SE);
}
REP (i, 0, m) {
xy[i] = MP(ta[i].FI + ta[i].SE, (ta[i].FI - ta[i].SE));
}
sort(xy, xy + m);
REP (i, 0, m) {
int pos = lower_bound(ALL(lis), -xy[i].SE) - lis.begin();
if (pos == lis.size()) {
lis.pb(-xy[i].SE);
} else {
lis[pos] = -xy[i].SE;
}
}
printf("%d\n", (int) lis.size());
return 0;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
