Submission #712657

#TimeUsernameProblemLanguageResultExecution timeMemory
712657minhnhatnoeAliens (IOI16_aliens)C++17
0 / 100
0 ms212 KiB
#include "aliens.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll sq(ll a) {return a * a;} ll take_photos(int n, int m, int k, vector<int> r, vector<int> c){ sort(r.begin(), r.end()); vector<ll> dp1(n, 1e15), dp2(n); while (k--){ for (int i=0; i<n; i++){ dp2[i] = dp1[i]; for (int j=0; j<=i; j++){ dp2[i] = min(dp2[i], (j ? dp1[j-1] : 0) + sq(r[i] - r[j] + 1)); } } swap(dp1, dp2); } return dp2.back(); }
#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...