# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1033210 | nvujica | Scales (IOI15_scales) | C++14 | 1 ms | 440 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"
#define ll long long
#define fi first
#define se second
using namespace std;
const int maxn = 1e5 + 10;
//vector <vector<int> > v;
//
//int MIN(int a, int b, int c){
// return min(min(a, b), c);
//}
//
//int MAX(int a, int b, int c){
// return max(max(a, b), c);
//}
//
//int MID(int a, int b, int c){
// return a + b + c - MIN(a, b, c) - MAX(a, b, c);
//}
//int getMedian(int A, int B, int C){
// cout << "mid " << A << ' ' << B << ' ' << C << endl;
// int odg;
// cin >> odg;
// return odg;
//}
//int getHeaviest(int A, int B, int C){
// cout << "max " << A << ' ' << B << ' ' << C << endl;
// int odg;
// cin >> odg;
// return odg;
//}
//int getLightest(int A, int B, int C){
// cout << "min " << A << ' ' << B << ' ' << C << endl;
// int odg;
// cin >> odg;
// return odg;
//}
//int getNextLightest(int A, int B, int C, int D){
// cout << "next " << A << ' ' << B << ' ' << C << ' ' << D << endl;
// int odg;
// cin >> odg;
// return odg;
//}
void init(int T){
}
void orderCoins(){
// vector <int> p;
// for(int i = 1; i <= 6; i++){
// p.push_back(i);
// }
//
// do{
// v.push_back(p);
// }while(next_permutation(p.begin(), p.end()));
int min123 = getLightest(1, 2, 3);
int mid123 = getMedian(1, 2, 3);
int max123 = 6 - min123 - mid123;
int min456 = getLightest(4, 5, 6);
int mid456 = getMedian(4, 5, 6);
int max456 = 15 - min456 - mid456;
vector <int> a[5];
int poz[7];
poz[min123] = 1;
poz[mid123] = 2;
poz[max123] = 3;
int arr[7];
arr[1] = min123;
arr[2] = mid123;
arr[3] = max123;
a[poz[getNextLightest(min123, mid123, max123, min456)]].push_back(min456);
a[poz[getNextLightest(min123, mid123, max123, mid456)]].push_back(mid456);
a[poz[getNextLightest(min123, mid123, max123, max456)]].push_back(max456);
if(getLightest(min123, min456, mid123) == min123) swap(a[1], a[4]);
int w[6], w2[6];
int cnt = 0;
for(int i = 1; i <= 4; i++){
for(int j = 0; j < a[i].size(); j++){
w[cnt++] = a[i][j];
}
if(i < 4) w[cnt++] = arr[i];
}
// for(int i = 0; i < 6; i++){
// w2[w[i] - 1] = i + 1;
// }
// for(int i = 0; i < 6; i++){
// cout << w[i] << ' ';
// }
// cout << endl;
answer(w);
}
//int main(){
// orderCoins();
//}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |