# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1109380 | Ludissey | 나일강 (IOI24_nile) | C++17 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "nile.h"
#define int long long
#include <bits/stdc++.h>
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;
vector<int> parent;
vector<int> sz;
vector<int> mn;
long long sm=0;
int getParent(int x){
if(parent[x]==x) return x;
return parent[x]=getParent(parent[x]);
}
void unite(int a, int b){
a=getParent(a); b=getParent(b);
if(a==b) return;
parent[b]=a;
if(sz[a]<sz[b]) swap(a,b);
if(sz[a]%2) sm-=mn[a];
if(sz[b]%2) sm-=mn[b];
sz[a]+=sz[b];
mn[a]=min(mn[a],mn[b]);
if(sz[a]%2) sm+=mn[a];
}
std::vector<long long> calculate_costs(std::vector<signed> W, std::vector<signed> A, std::vector<signed> B, std::vector<signed> E) {
int q = sz(E);
int n=sz(W);
mn.resize(n); sz.resize(n); parent.resize(n);
vector<pair<int,int>> e(q);
vector<pair<int,pair<int,int>>> a(n);
for (int i = 0; i < n; i++) e[i]={E[i],i};
for (int i = 0; i < n; i++) a[i]={W[i],{A[i],B[i]}};
sort(all(a));
sort(all(e));
vector<pair<int,int>> df(n-1);
for (int i = 0; i < n-1; i++) df[i]={a[i+1].first-a[i].first,i};
sm=0;
for (int i = 0; i < n; i++)
{
sm+=a[i].second.first;
sz[i]=1;
parent[i]=i;
mn[i]=a[i].second.first-a[i].second.second;
}
sort(all(df));
std::vector<long long> R(q, 0);
int j=0;
for (int i = 0; i < q; i++)
{
while(j<n-1){
if(df[j].first>e[i].first) break;
unite(df[j].second,df[i].second+1);
j++;
}
R[e[i].second]=sm;
}
return R;
}
컴파일 시 표준 에러 (stderr) 메시지
nile.cpp:2:13: error: 'long' and 'short' specified together 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long' and 'short' specified together 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long' and 'short' specified together 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long' and 'short' specified together 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long' and 'short' specified together 2 | #define int long long | ^~~~ In file included from /usr/include/c++/10/cmath:45, from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41, from nile.cpp:3: nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:13: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ nile.cpp:2:18: error: 'long long long' is too long for GCC 2 | #define int long long | ^~~~ /var/local/li