Submission #1010288

#TimeUsernameProblemLanguageResultExecution timeMemory
1010288aaaaaarrozAliens (IOI16_aliens)C++17
Compilation error
0 ms0 KiB
#include "aliens.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using pair<int,int> = pair<int, int>; ll take_photos(int n, int m, int k, vector<int> r, vector<int> c) { vector<pair<int,int>> P; P.push_back({ -1, -1 }); for(int i=0; i<n; i++) { if(r[i] > c[i]) P.push_back({ c[i], r[i] }); else P.push_back({ r[i], c[i] }); } sort(P.begin(), P.end(), [&](pair<int,int> a, pair<int,int> b) { if(a.first == b.first) return a.second > b.second; return a.first < b.first; }); vector<pair<int,int>> P2; P2.push_back(P[0]); P2.push_back(P[1]); for(int i=2; i<=n; i++) { if(P[i].first <= P2.back().second && P[i].second <= P2.back().second) continue; P2.push_back(P[i]); } P = P2; n = P.size() - 1; ll dp[n+1][k+1]; for(int i=0; i<=n; i++) for(int j=0; j<=k; j++) dp[i][j] = 1e9; dp[0][0] = 0; for(int i=1; i<=n; i++) { for(int j=1; j<=k; j++) { for(int x=i; x>=1; x--) { dp[i][j] = min(dp[i][j], dp[x-1][j-1] + (P[i].second - P[x].first + 1) * (P[i].second - P[x].first + 1) - max(0, (P[x-1].second - P[x].first + 1)) * max(0, (P[x-1].second - P[x].first + 1)) ); } } } return *min_element(dp[n], dp[n]+k+1); }

Compilation message (stderr)

aliens.cpp:5:7: error: expected nested-name-specifier
    5 | using pair<int,int> = pair<int, int>;
      |       ^~~~~~~~~~~~~