# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
968723 | APROHACK | Scales (IOI15_scales) | C++17 | 1 ms | 436 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#include "scales.h"
using namespace std;
void init(int T) {
/* ... */
}
vector<int> obtener_monedas(set<int>&num){
vector<int>ans;
for(auto i : num){
// i va tomar el valor de cada elemento en el set
ans.push_back(i);
}
return ans;
}
void orderCoins() {
/* ... */
int w[6];
set<int> num = {1,2,3,4,5,6};
int a = getLightest(1,2,3);
int b = getLightest(4,5,6);
int c;
for (int i = 0; i < 3; i++){
if (a != i+1){
c = i+1;
break;
}
}
w[0] = getLightest(a,b,c);
num.erase(w[0]);
vector<int> numeros = obtener_monedas(num);
a = getLightest(numeros[0], numeros[1], numeros[2]);
w[1] = getLightest(a, numeros[3], numeros[4]);
num.erase(w[1]);
numeros = obtener_monedas(num);
a = getLightest(numeros[0], numeros[1], numeros[2]);
w[2] = getMedian (w[1], a, numeros[3]);
num.erase(w[2]);
numeros = obtener_monedas(num);
w[3] = getLightest(numeros[0], numeros[1], numeros[2]);
w[4] = getMedian(numeros[0], numeros[1], numeros[2]);
num.erase(w[3]);
num.erase(w[4]);
numeros = obtener_monedas(num);
w[5] = numeros[0];
answer(w);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |