제출 #1076287

#제출 시각아이디문제언어결과실행 시간메모리
1076287hasan2006Aliens (IOI16_aliens)C++17
12 / 100
58 ms4460 KiB
#include "aliens.h"
#include <bits/stdc++.h>
using namespace std;

#define TL ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define rall(s) s.rbegin(),s.rend()
#define all(s) s.begin(),s.end()
#define pb push_back
#define se second
#define fi first
#define ll long long
#define ld long double
#define YES cout<<"YES\n"
#define Yes cout<<"Yes\n"
#define yes cout<<"yes\n"
#define NO cout<<"NO\n"
#define No cout<<"No\n"
#define no cout<<"no\n"


const int N = 5e3 + 9 , mod = 1e9 + 7;
ll a[N] , b[N] , dp[N][N] , c[N] , d[N] ;


long long take_photos(int n, int m, int k, std::vector<int> a, std::vector<int> b) {
    ll i , j , l , s  = 0 , f , x , y ;
    set<int>st;
    vector<int>v;
    for(i = 0; i < n; i++)
        st.insert(a[i]);
    v.pb(0);
    for(auto to : st)
        v.pb(to);
    n = v.size() - 1;
    for(i = 0; i <= n; i++)
        for(j = 0; j <= n; j++)
            dp[i][j] = 1e18;
    dp[0][0] = 0;
    ll mn = 1e18;
    for(int i = 1; i <= n; i++) {
        for(j = 1; j <= min(k , i); j++) {
            dp[i][j] = min(dp[i][j] , dp[i][j - 1]);
            for(x = 1;  x <= i; x++)
                dp[i][j] = min(dp[i][j] , dp[x - 1][j - 1] + (v[i] - v[x] + 1) * (v[i] - v[x] + 1));

            if(i == n)
                mn = min(mn , dp[i][j]);
        }
        }
    return mn;
}

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

aliens.cpp: In function 'long long int take_photos(int, int, int, std::vector<int>, std::vector<int>)':
aliens.cpp:26:16: warning: unused variable 'l' [-Wunused-variable]
   26 |     ll i , j , l , s  = 0 , f , x , y ;
      |                ^
aliens.cpp:26:20: warning: unused variable 's' [-Wunused-variable]
   26 |     ll i , j , l , s  = 0 , f , x , y ;
      |                    ^
aliens.cpp:26:29: warning: unused variable 'f' [-Wunused-variable]
   26 |     ll i , j , l , s  = 0 , f , x , y ;
      |                             ^
aliens.cpp:26:37: warning: unused variable 'y' [-Wunused-variable]
   26 |     ll i , j , l , s  = 0 , f , x , y ;
      |                                     ^
#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...