Submission #592779

#TimeUsernameProblemLanguageResultExecution timeMemory
592779PiejanVDCAliens (IOI16_aliens)C++17
0 / 100
1 ms212 KiB
#include "aliens.h" #include <bits/stdc++.h> using namespace std; long long take_photos(int n, int m, int k, vector<int>r, vector<int>c) { long long dp[n+5]; dp[0] = 0; sort(r.begin(), r.end()); for(int i = 1 ; i <= n ; i++) { dp[i] = LLONG_MAX; for(int ii = 0 ; ii < i ; ii++) { dp[i] = min(dp[i], dp[ii] + (long long) (r[i-1] - r[ii] + 1) * (r[i-1] - r[ii] + 1)); } } return dp[n]; }
#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...