Submission #347490

#TimeUsernameProblemLanguageResultExecution timeMemory
347490juggernautAliens (IOI16_aliens)C++14
0 / 100
2 ms2284 KiB
#include"aliens.h" #include<bits/stdc++.h> #ifdef EVAL #else #include"grader.cpp" #endif using namespace std; typedef long long ll; ll dp[505][505]; ll sq(ll a){ return a*a; } ll take_photos(int n,int m,int k,vector<int>r,vector<int>c){ r.push_back(-2e9); sort(r.begin(),r.end()); for(int i=0;i<505;i++) for(int j=0;j<505;j++)dp[i][j]=2e9; dp[0][0]=0; for(int i=1;i<=k;i++) for(int j=1;j<=n;j++) for(int l=1;l<=j;l++)dp[j][i]=min(dp[j][i],dp[l-1][i-1]+sq(r[j]-r[l]+1)); return dp[n][k]; }
#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...