Submission #935706

#TimeUsernameProblemLanguageResultExecution timeMemory
935706vjudge1Arcade (NOI20_arcade)C++17
100 / 100
175 ms14688 KiB
#include <bits/stdc++.h> using namespace std; int n,m,t[500001],a[500001]; 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=1;i<=m;i++) cin >> t[i]; for (int i=1;i<=m;i++){ cin >> a[i]; p.push_back({t[i]+a[i],t[i]-a[i]}); } 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...