제출 #103776

#제출 시각아이디문제언어결과실행 시간메모리
103776figter001Aliens (IOI16_aliens)C++17
0 / 100
3 ms408 KiB
#include "aliens.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; const int nax = 4010; int dp[nax][nax]; pair<int,int> p[nax]; long long take_photos(int n, int m, int k, vector<int> r, vector<int> c) { for(int i=0;i<=n;i++) for(int j=0;j<=k;j++) dp[j][i] = 1e9; for(int i=1;i<=n;i++) p[i] = {r[i-1],c[i-1]}; sort(p+1,p+n+1); dp[0][0] = 0; for(int u=1;u<=k;u++){ for(int i=1;i<=n;i++){ int x = p[i].first; int y = p[i].second; for(int l = 1;l<=i;l++){ int sz = (x - p[l].first + 1) * (x - p[l].first + 1); dp[u][i] = min(dp[u][i],dp[u-1][l-1] + sz); } } } return dp[k][n]; }

컴파일 시 표준 에러 (stderr) 메시지

aliens.cpp: In function 'long long int take_photos(int, int, int, std::vector<int>, std::vector<int>)':
aliens.cpp:25:8: warning: unused variable 'y' [-Wunused-variable]
    int y = p[i].second;
        ^
#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...