제출 #1166586

#제출 시각아이디문제언어결과실행 시간메모리
1166586NxmkxingAliens (IOI16_aliens)C++20
0 / 100
0 ms328 KiB
#include "aliens.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using pll = pair<long long, long long>; const ll inf = 1e18; const int N = 1e5 + 10; const int M = 1e6 + 10; ll n, f[N], mx, minR[M], bestR[M], mxC[M], bestC[M], x[N], y[N], dp[N]; vector<pll> v, v2, a; ll take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) { for (int i = 0; i < n; i++) if (r[i] > c[i]) swap(r[i], c[i]); for (int i = 0; i < n; i++) v.push_back({r[i], c[i]}); sort(v.begin(), v.end()); for (int i = 0; i < n; i++) { if (i == n - 1 || v[i].first != v[i+1].first) { v2.push_back(v[i]); } } n = 0; mx = -1; for (int i = 0; i < v2.size(); i++) { if (v2[i].second <= mx) continue; x[++n] = v2[i].first; y[n] = v2[i].second; mx = v2[i].second; } ::n = n; //cout << "\n" << n << "\n"; for (int i = 1; i <= n; i++) cout << x[i] << " " << y[i] << "\n"; // solve for (int i = 1; i <= n; i++) dp[i] = inf; for (int i = 1; i <= n; i++) for (int j = 1; j <= i; j++) dp[i] = min(dp[i], dp[j-1] + (y[i] - x[j] + 1) * (y[i] - x[j] + 1)); //for (int i = 1; i <= n; i++) cout << dp[i] << " "; return dp[n]; }

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

aliens.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
aliens_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
#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...