# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
594662 | 1ne | Let's Win the Election (JOI22_ho_t3) | C++14 | 1460 ms | 8476 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
double long n,k;cin>>n>>k;
vector<pair<double long,double long>>arr,temp;
for (int i = 0;i<n;++i){
double long x,y;cin>>x>>y;
if (y == -1){
y = 1e7;
}
arr.push_back({x,y});
}
sort(arr.begin(),arr.end(),[&](auto x,auto y){
if (x.second == y.second)return x.first < y.first;
return x.second < y.second;
});
for (auto x:temp)arr.push_back(x);
double long mxn = 1e15;
vector<vector<double long>>dp(n + 1,vector<double long>(n + 2,mxn));
dp[0][0] = 0.0;
for (int i = 0;i<n;++i){
vector<vector<double long>>cur_dp(n + 1,vector<double long>(n + 2,mxn));
for (int j = 0;j<=i;++j){
for (int p = 0;p <= j + 1;++p){
cur_dp[j][p] = min(cur_dp[j][p],dp[j][p]);
cur_dp[j + 1][p + 1] = min(cur_dp[j + 1][p + 1],dp[j + 1][p + 1]);
cur_dp[j + 1][p] = min(cur_dp[j + 1][p],dp[j + 1][p]);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |