제출 #555711

#제출 시각아이디문제언어결과실행 시간메모리
555711FidanAliens (IOI16_aliens)C++17
0 / 100
1 ms340 KiB
#include "aliens.h" #include <bits/stdc++.h> using namespace std; typedef int ll; long long take_photos(int n, int m, int k, vector<int> r, vector<int> c) { vector<vector<long long>> dp(n+1, vector<long long> (k+1, n*n+10)); for(ll i=0; i<n; i++){ r[i]++; } sort(r.begin(), r.end()); for(ll i: r){ dp[i][1]=(i-r[0]+1)*(i-r[0]+1); } for(ll i: r){ for(ll j=1; j<=k; j++){ for(ll h=0; h<j; h++){ dp[i][j]=min(dp[i][h], dp[i][j]); } for(ll h: r){ if(h>i) break; dp[i][j]=min(dp[i][j], dp[h-1][j-1]+(i-h+1)*(i-h+1)); } } } return dp[r[n-1]][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...