Submission #138800

# Submission time Handle Problem Language Result Execution time Memory
138800 2019-07-30T10:37:38 Z Talant Scales (IOI15_scales) C++17
0 / 100
3 ms 400 KB
#include "scales.h"
//#include "grader.cpp"

#include <bits/stdc++.h>

#define sc second
#define fr first
#define mk make_pair
#define pb push_back

using namespace std;

const int N = (1e6 + 5);
const int inf = (1e9 + 7);


int t;
int a[7];

void init(int T) {
      t = T;
}

void orderCoins() {

      a[2] = getHeaviest(1,2,3);
      a[1] = getMedian(1,2,3);
      a[0] = 6 - (a[2] + a[1]);

      a[5] = getHeaviest(4,5,6);
      a[4] = getMedian(4,5,6);
      a[3] = 15 - a[5] - a[4];

      ///1

      int o = getNextLightest(a[1],a[2],a[0],a[3]);
      int cur = a[3];
      if (o == a[0]) {
            int oo = getLightest(a[0],a[1],cur);
            if (oo == cur) {
                  for (int i = 2; i >= 0; i --)
                        a[i + 1] = a[i];
                  a[0] = cur;
            }
            else {
                  answer(a);
            }
      }
      else {
            for (int i = 2; i >= 1; i --) {
                  a[i + 1] = a[i];
                  if (a[i] == o) {
                        a[i] = cur;
                        break;
                  }
            }
      }

      ///2

      o = getNextLightest(a[1],a[2],a[3],a[4]);
      cur = a[4];
      if (o == a[1]) {
            int oo = getLightest(a[1],a[2],cur);
            if (oo == cur) {
                  for (int i = 3; i >= 1; i --)
                        a[i + 1] = a[i];
                  a[1] = cur;
            }
            else {
                  answer(a);
            }
      }
      else {
            for (int i = 3; i >= 2; i --) {
                  a[i + 1] = a[i];
                  if (a[i] == o) {
                        a[i] = cur;
                        break;
                  }
            }
      }

      ///3

      o = getNextLightest(a[4],a[2],a[3],a[5]);
      cur = a[5];

      if (o == a[2]) {
            int oo = getLightest(a[2],a[3],cur);
            if (oo == cur) {
                  for (int i = 4; i >= 2; i --)
                        a[i + 1] = a[i];
                  a[2] = cur;
            }
            else {
                  answer(a);
            }
      }
      else {
            for (int i = 4; i >= 3; i --) {
                  a[i + 1] = a[i];
                  if (a[i] == o) {
                        a[i] = cur;
                        break;
                  }
            }
      }

      answer(a);
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Incorrect 2 ms 376 KB Output isn't correct
4 Incorrect 2 ms 376 KB Output isn't correct
5 Incorrect 2 ms 376 KB Output isn't correct
6 Incorrect 2 ms 376 KB Output isn't correct
7 Incorrect 2 ms 256 KB Output isn't correct
8 Incorrect 2 ms 256 KB Output isn't correct
9 Incorrect 2 ms 376 KB Output isn't correct
10 Incorrect 2 ms 256 KB Output isn't correct
11 Incorrect 2 ms 256 KB Output isn't correct
12 Incorrect 2 ms 376 KB Output isn't correct
13 Incorrect 3 ms 400 KB Output isn't correct
14 Incorrect 2 ms 256 KB Output isn't correct
15 Incorrect 2 ms 376 KB Output isn't correct
16 Incorrect 2 ms 376 KB Output isn't correct
17 Incorrect 2 ms 376 KB Output isn't correct
18 Incorrect 2 ms 256 KB Output isn't correct
19 Incorrect 3 ms 376 KB Output isn't correct
20 Incorrect 2 ms 256 KB Output isn't correct
21 Incorrect 2 ms 376 KB Output isn't correct
22 Incorrect 2 ms 376 KB Output isn't correct
23 Incorrect 3 ms 376 KB Output isn't correct
24 Incorrect 3 ms 376 KB Output isn't correct
25 Incorrect 2 ms 376 KB Output isn't correct
26 Incorrect 2 ms 376 KB Output isn't correct
27 Incorrect 2 ms 256 KB Output isn't correct
28 Incorrect 2 ms 256 KB Output isn't correct
29 Incorrect 2 ms 256 KB Output isn't correct
30 Incorrect 2 ms 256 KB Output isn't correct
31 Incorrect 2 ms 256 KB Output isn't correct
32 Incorrect 2 ms 376 KB Output isn't correct
33 Incorrect 2 ms 376 KB Output isn't correct
34 Incorrect 2 ms 256 KB Output isn't correct
35 Incorrect 2 ms 256 KB Output isn't correct
36 Incorrect 2 ms 256 KB Output isn't correct
37 Incorrect 2 ms 256 KB Output isn't correct
38 Incorrect 2 ms 256 KB Output isn't correct
39 Incorrect 2 ms 376 KB Output isn't correct
40 Incorrect 2 ms 376 KB Output isn't correct