Submission #204051

# Submission time Handle Problem Language Result Execution time Memory
204051 2020-02-24T03:29:10 Z Segtree Scales (IOI15_scales) C++14
Compilation error
0 ms 0 KB
#include"scales.h"
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
#define mad(a,b) a=(a+b)%mod
/*int VALUE[6];
int getLightest(int a,int b,int c){
	a--,b--,c--;
	vector<P> v;
	v.push_back(make_pair(VALUE[a],a));
	v.push_back(make_pair(VALUE[b],b));
	v.push_back(make_pair(VALUE[c],c));
	sort(v.begin(),v.end());
	return v[0].second+1;
}
int getMedian(int a,int b,int c){
	a--,b--,c--;
	vector<P> v;
	v.push_back(make_pair(VALUE[a],a));
	v.push_back(make_pair(VALUE[b],b));
	v.push_back(make_pair(VALUE[c],c));
	sort(v.begin(),v.end());
	return v[1].second+1;
}
int getHeaviest(int a,int b,int c){
	a--,b--,c--;
	vector<P> v;
	v.push_back(make_pair(VALUE[a],a));
	v.push_back(make_pair(VALUE[b],b));
	v.push_back(make_pair(VALUE[c],c));
	sort(v.begin(),v.end());
	return v[2].second+1;
}
void answer(int w[]){
	rep(i,6)cout<<w[i]<<" "; cout<<endl;
}*/

void init(int T){
	return;
}
void OrderCoins(){
	int w[6];
	int v1=getLightest(1,2,3);
	int v2=getLightest(v1,4,5);
	int v3=getLightest(v2,6,(v2==1?2:1));
	w[0]=v3;
	vector<int> a;
	for(int i=1;i<=6;i++)if(i!=w[0])a.push_back(i);
	int v4=getLightest(a[0],a[1],a[2]);
	int v5=getLightest(v4,a[3],a[4]);
	w[1]=v5;
	vector<int> b;
	for(int i=1;i<=6;i++)if(i!=w[0]&&i!=w[1])b.push_back(i);
	int v6=getLightest(b[0],b[1],b[2]);
	int v7=getLightest(v6,b[3],(v6==b[0]?b[1]:b[0]));
	w[2]=v7;
	vector<int> c;
	for(int i=1;i<=6;i++)if(i!=w[0]&&i!=w[1]&&i!=w[2])c.push_back(i);
	int v8=getLightest(c[0],c[1],c[2]);
	int v9=getMedian(c[0],c[1],c[2]);
	w[3]=v8,w[4]=v9;
	for(int i=0;i<3;i++)if(c[i]!=v8&&c[i]!=v9)w[5]=c[i];
	answer(w);
}/*
int main(){
	init(10);
	rep(u,10){
		rep(i,6)VALUE[i]=i;
		rep(u,100)swap(VALUE[rand()%6],VALUE[rand()%6]);
		OrderCoins();
		vector<P> v;
		rep(i,6)v.push_back(make_pair(VALUE[i],i+1));
		sort(v.begin(),v.end());
		rep(i,6)cout<<v[i].second<<" "; cout<<endl;cout<<"--"<<endl;
	}
}*/

Compilation message

scales.cpp: In function 'void init(int)':
scales.cpp:45:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T){
               ^
/tmp/ccSokiM7.o: In function `main':
grader.c:(.text.startup+0xe1): undefined reference to `orderCoins'
collect2: error: ld returned 1 exit status