Submission #272509

#TimeUsernameProblemLanguageResultExecution timeMemory
272509dooweyArcade (NOI20_arcade)C++14
7 / 100
1 ms384 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; #define fi first #define se second #define mp make_pair #define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); int main(){ fastIO; int n, m; cin >> n >> m; pii z[m]; for(int i = 0 ; i < m; i ++ ){ cin >> z[i].fi; } for(int i = 0 ; i < m; i ++ ){ cin >> z[i].se; } sort(z, z + m); int answer = 1; int cur; int T; int las; for(int i = 1 ; i < m; i ++ ){ for(int j = i - 1; j >= 0 ; j -- ){ if(z[i].fi - z[j].fi < abs(z[i].se - z[j].se)){ T = z[i].fi - z[j].fi; vector<int> res; las = z[i].fi; for(int k = j + 1; k < i ; k ++ ){ if(abs(z[k].se - z[i].se) > T && abs(z[k].se - z[j].se) > T){ res.push_back(z[k].se); } } cur = 2; sort(res.begin(), res.end()); for(auto x : res){ if(x - las > T){ las = x; cur ++ ; } } answer = max(answer, cur); } } } cout << answer << "\n"; return 0; }
#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...