Submission #1367839

#TimeUsernameProblemLanguageResultExecution timeMemory
1367839FaresSTH나일강 (IOI24_nile)C++20
Compilation error
0 ms0 KiB
#include"bits/stdc++.h"
using namespace std;
using ll=long long;
#define S second
#define F first
struct artifact{int w,a,b,c};
vector<ll>calculate_costs(vector<int>w,vector<int>a,vector<int>b,vector<int>e){
	int n=w.size(),q=e.size();
	vector<artifact>v(n);
	
	for(int i=0;i<n;i++)v[i]=artifact{w[i],a[i],b[i],a[i]-b[i]};
	sort(v.begin(),v.end(),[](auto a,auto b){return a.c<b.c;});
	return vector<ll>(accumulate(b.begin(),b.end(),0ll)+(n%2?v.back().c:0),q);
}

Compilation message (stderr)

nile.cpp:6:27: error: expected ';' at end of member declaration
    6 | struct artifact{int w,a,b,c};
      |                           ^
      |                            ;