# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
284251 | 2020-08-27T05:31:18 Z | 임성재(#5754) | Arcade (NOI20_arcade) | C++17 | 1 ms | 384 KB |
#include<bits/stdc++.h> using namespace std; #define fast ios::sync_with_stdio(false); cin.tie(0); #define fi first #define se second #define em emplace #define eb emplace_back #define mp make_pair #define all(v) (v).begin(), (v).end() typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; const int inf = 1e9; const ll INF = 1e18; int n, m; vector<pii> v; vector<int> ans; int a[500010]; int t[500010]; int main() { fast; cin >> n >> m; for(int i=1; i<=m; i++) { cin >> a[i]; } for(int i=1; i<=m; i++) { cin >> t[i]; v.eb(t[i] + a[i], t[i] - a[i]); } sort(all(v)); reverse(all(v)); for(auto i : v) { int k = lower_bound(all(ans), i.se) - ans.begin(); if(k < ans.size()) ans[k] = i.se; else ans.eb(i.se); } cout << ans.size(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |