Submission #65265

#TimeUsernameProblemLanguageResultExecution timeMemory
65265FedericoSAliens (IOI16_aliens)C++14
0 / 100
3 ms480 KiB
#include <iostream> #include <algorithm> #include "aliens.h" using namespace std; typedef long long int ll; int N,M,K; ll DP[1005][1005]; bool B[1005]; long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) { N=n; M=m; K=k; for(int i=0;i<N;i++) DP[r[i]][c[i]]=1; for(ll k=1;k<M;k++) for(ll i=0;i+k<M;i++){ ll j=i+k; DP[i][j]=(j-i+1)*(j-i+1); for(ll p=i;p<j;p++) DP[i][j]=min(DP[i][j],DP[i][p]+DP[p+1][j]); } return DP[0][M-1]; } /* 2 7 2 1 1 3 3 */
#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...