Submission #204052

# Submission time Handle Problem Language Result Execution time Memory
204052 2020-02-24T03:29:47 Z Segtree Scales (IOI15_scales) C++14
45.4545 / 100
6 ms 376 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){
               ^
# Verdict Execution time Memory Grader output
1 Partially correct 5 ms 376 KB Output is partially correct
2 Partially correct 5 ms 256 KB Output is partially correct
3 Partially correct 5 ms 256 KB Output is partially correct
4 Partially correct 5 ms 376 KB Output is partially correct
5 Partially correct 5 ms 376 KB Output is partially correct
6 Partially correct 5 ms 376 KB Output is partially correct
7 Partially correct 5 ms 376 KB Output is partially correct
8 Partially correct 5 ms 256 KB Output is partially correct
9 Partially correct 5 ms 256 KB Output is partially correct
10 Partially correct 5 ms 256 KB Output is partially correct
11 Partially correct 5 ms 256 KB Output is partially correct
12 Partially correct 5 ms 256 KB Output is partially correct
13 Partially correct 5 ms 256 KB Output is partially correct
14 Partially correct 5 ms 256 KB Output is partially correct
15 Partially correct 5 ms 128 KB Output is partially correct
16 Partially correct 5 ms 256 KB Output is partially correct
17 Partially correct 5 ms 376 KB Output is partially correct
18 Partially correct 5 ms 256 KB Output is partially correct
19 Partially correct 5 ms 256 KB Output is partially correct
20 Partially correct 5 ms 376 KB Output is partially correct
21 Partially correct 5 ms 256 KB Output is partially correct
22 Partially correct 5 ms 256 KB Output is partially correct
23 Partially correct 5 ms 256 KB Output is partially correct
24 Partially correct 5 ms 256 KB Output is partially correct
25 Partially correct 5 ms 256 KB Output is partially correct
26 Partially correct 6 ms 256 KB Output is partially correct
27 Partially correct 5 ms 256 KB Output is partially correct
28 Partially correct 5 ms 256 KB Output is partially correct
29 Partially correct 5 ms 376 KB Output is partially correct
30 Partially correct 5 ms 256 KB Output is partially correct
31 Partially correct 5 ms 376 KB Output is partially correct
32 Partially correct 5 ms 376 KB Output is partially correct
33 Partially correct 5 ms 256 KB Output is partially correct
34 Partially correct 5 ms 256 KB Output is partially correct
35 Partially correct 5 ms 256 KB Output is partially correct
36 Partially correct 5 ms 256 KB Output is partially correct
37 Partially correct 5 ms 256 KB Output is partially correct
38 Partially correct 5 ms 256 KB Output is partially correct
39 Partially correct 5 ms 256 KB Output is partially correct
40 Partially correct 5 ms 256 KB Output is partially correct