Submission #357972

#TimeUsernameProblemLanguageResultExecution timeMemory
357972amunduzbaevScales (IOI15_scales)C++14
0 / 100
1 ms512 KiB
#include "scales.h"

#ifndef EVAL
#include "grader.cpp"
#endif

#include "bits/stdc++.h"
using namespace std;
#define sz(x) (int)x.size()
#define pb push_back

void init(int T) {
    
}

void orderCoins(){
	
	vector<int> res = {1, 2, 3, 4, 5, 6}, ans; 
	vector<int>::iterator x;
	
	int a = res[0], b = res[1], c = res[2];
	int mn = getLightest(a, b, c);
	a = res[5], b = res[3], c = res[4];
	int mm = getLightest(a, b, c);
	int in = 0;
	while(res[in] == mn && in < 3) in++;
	mn = getLightest(mn, mm, res[in]);
	ans.pb(mn);
	for(x = res.begin(); x!=res.end(); x++) if((*x) == mn) break;
	res.erase(x);
	
	a = res[0], b = res[1], c = res[2];
	mn = getLightest(a, b, c);
	ans.pb(mn);
	mn = getLightest(mn, res[3], res[4]);
	for(x = res.begin(); x!=res.end(); x++) if((*x) == mn) break;
	res.erase(x);
	
	a = res[0], b = res[1], c = res[2];
	mn = getLightest(a, b, c);
	in = 0;
	while(res[in] == mn && in < 3) in++;
	mn = getLightest(mn, res[in], res[3]);
	ans.pb(mn);
	for(x = res.begin(); x!=res.end(); x++) if((*x) == mn) break;
	res.erase(x);
	
	a = res[0], b = res[1], c = res[2];
	mn = getLightest(a, b, c);
	ans.pb(mn);
	mn = getMedian(a, b, c);
	ans.pb(mn);
	mn = getHeaviest(a, b, c);
	ans.pb(mn);
	
    int w[6];
    
    for(int i=0;i<6;i++) w[i] = ans[i];
    //for(int i=0;i<6;i++) cout<<w[i]<<" ";
    //puts("");
    answer(w);
}

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:12:15: warning: unused parameter 'T' [-Wunused-parameter]
   12 | void init(int T) {
      |           ~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...