답안 #613573

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
613573 2022-07-30T06:44:19 Z rrrr10000 장난감 기차 (IOI17_train) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef tuple<ll,ll,ll> PP;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define REP(i,k,n) for(ll i=(ll)(k);i<(ll)(n);i++)
#define all(a) a.begin(),a.end()
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pb emplace_back
template<class T> void out(T a){cout<<a<<endl;}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<endl;}
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
const ll inf=1001001001001001001;

#include "wiring.h"

long long min_total_length(std::vector<int> r, std::vector<int> b) {
	vp v;
    rep(i,r.size())v.pb(r[i],0);
    rep(i,b.size())v.pb(b[i],1);
    sort(all(v));
    ll n=v.size();
    vi dp(n+1,inf);
    dp[0]=0;
    rep(i,n)REP(j,i+1,n+1){
        vi dif;
        REP(k,i,j-1)if(v[k].se!=v[k+1].se)dif.pb(k);
        if(dif.size()!=1)continue;
        ll sum=0;
        REP(k,i,dif[0]+1)sum-=v[k].fi;
        REP(k,dif[0]+1,j)sum+=v[k].fi;
        sum+=max(0ll,(j-dif[0]-1)-(dif[0]+1-i))*(-v[dif[0]].fi);
        sum+=max(0ll,-(j-dif[0]-1)+(dif[0]+1-i))*v[dif[0]+1].fi;
        chmin(dp[j],dp[i]+sum);
    }
    return dp[n];
}

Compilation message

train.cpp:23:10: fatal error: wiring.h: No such file or directory
   23 | #include "wiring.h"
      |          ^~~~~~~~~~
compilation terminated.