Submission #712658

#TimeUsernameProblemLanguageResultExecution timeMemory
712658minhnhatnoeAliens (IOI16_aliens)C++17
12 / 100
100 ms312 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 dp1.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...