Submission #935767

#TimeUsernameProblemLanguageResultExecution timeMemory
935767abcvuitunggioArcade (NOI20_arcade)C++17
100 / 100
186 ms15008 KiB
#include <bits/stdc++.h> using namespace std; int n,m,t[500001],a; vector <pair <int, int>> p; set <int> s; int main(){ ios_base::sync_with_stdio(NULL);cin.tie(nullptr); cin >> n >> m; for (int i=0;i<m;i++) cin >> t[i]; for (int i=0;i<m;i++){ cin >> a; p.push_back({t[i]+a,t[i]-a}); } sort(p.begin(),p.end()); for (auto [i,j]:p){ auto it=s.lower_bound(-j); if (it!=s.end()) s.erase(it); s.insert(-j); } cout << s.size(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...