Submission #136878

# Submission time Handle Problem Language Result Execution time Memory
136878 2019-07-26T12:26:09 Z AyaBenSaad Scales (IOI15_scales) C++14
0 / 100
3 ms 380 KB
#include <bits/stdc++.h>
#include "scales.h"

using namespace std;

void init(int T) {
}

int ans[6];
int a[5], b[5];

void orderCoins() {
  a[1] = getLightest (1, 2, 3); 
  b[1] = getLightest (4, 5, 6);

  a[2] = getMedian (1, 2, 3); 
  b[2] = getMedian (4, 5, 6);

  a[3] = 1+2+3-a[1]-a[2];
  b[3] = 4+5+6-b[1]-b[2];

  ans[0] = getLightest(a[1], b[1], b[2]);
  int l = 1, r = 1;
  if (ans[0] == a[1]) l++;
  else if (ans[0] == b[1]) r++;

  ans[1] = getLightest(a[l], b[r], b[3]);
  if (ans[1] == a[l]) l++;
  else if (ans[1] == b[r]) r++;

  ans[2] = getLightest(a[l], b[r], (r == 3 ? a[3] : b[3]));
  if (ans[2] == a[l]) l++;
  else if (ans[2] == b[r]) r++;

  if (l > 3) ans[3] = getLightest(b[1], b[2], b[3]);
  else if (r > 3) ans[3] = getLightest (a[1], a[2], a[3]);
  else if (l <= 3 && r <= 3) ans[3] = getLightest(a[l], b[r], (r == 3 ? a[3] : b[3]));
  if (ans[3] == a[l]) l++;
  else if (ans[3] == b[r]) r++;

  /*if(l > 3) ans[4] = getMedian(ans[0], b[2], b[3]);
  else if(r > 3) ans[4] = getMedian(ans[0], a[2], a[3]);
  else ans[4] = getMedian(ans[0], a[3], b[3]);*/

  ans[5] = 1;//(6*7)/2 - (ans[0]+ans[1]+ans[2]+ans[3]+ans[4]);
    answer(ans);
}

Compilation message

scales.cpp: In function 'void init(int)':
scales.cpp:6:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 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 376 KB Output isn't correct
9 Incorrect 2 ms 376 KB Output isn't correct
10 Incorrect 2 ms 376 KB Output isn't correct
11 Incorrect 2 ms 376 KB Output isn't correct
12 Incorrect 2 ms 376 KB Output isn't correct
13 Incorrect 2 ms 256 KB Output isn't correct
14 Incorrect 2 ms 376 KB Output isn't correct
15 Incorrect 2 ms 376 KB Output isn't correct
16 Incorrect 1 ms 376 KB Output isn't correct
17 Incorrect 2 ms 376 KB Output isn't correct
18 Incorrect 2 ms 376 KB Output isn't correct
19 Incorrect 2 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 256 KB Output isn't correct
23 Incorrect 2 ms 376 KB Output isn't correct
24 Incorrect 2 ms 256 KB Output isn't correct
25 Incorrect 2 ms 292 KB Output isn't correct
26 Incorrect 2 ms 256 KB Output isn't correct
27 Incorrect 2 ms 376 KB Output isn't correct
28 Incorrect 2 ms 376 KB Output isn't correct
29 Incorrect 2 ms 376 KB Output isn't correct
30 Incorrect 2 ms 376 KB Output isn't correct
31 Incorrect 2 ms 376 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 376 KB Output isn't correct
35 Incorrect 3 ms 376 KB Output isn't correct
36 Incorrect 2 ms 376 KB Output isn't correct
37 Incorrect 2 ms 256 KB Output isn't correct
38 Incorrect 2 ms 380 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