Submission #136875

# Submission time Handle Problem Language Result Execution time Memory
136875 2019-07-26T12:23:39 Z AyaBenSaad Scales (IOI15_scales) C++14
0 / 100
5 ms 508 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 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 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Incorrect 2 ms 256 KB Output isn't correct
4 Incorrect 2 ms 256 KB Output isn't correct
5 Incorrect 2 ms 256 KB Output isn't correct
6 Incorrect 2 ms 256 KB Output isn't correct
7 Incorrect 3 ms 256 KB Output isn't correct
8 Incorrect 2 ms 256 KB Output isn't correct
9 Runtime error 4 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Incorrect 2 ms 376 KB Output isn't correct
11 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 3 ms 248 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Incorrect 2 ms 376 KB Output isn't correct
15 Incorrect 2 ms 376 KB Output isn't correct
16 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Incorrect 2 ms 256 KB Output isn't correct
21 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Incorrect 2 ms 256 KB Output isn't correct
23 Incorrect 2 ms 504 KB Output isn't correct
24 Incorrect 2 ms 256 KB Output isn't correct
25 Incorrect 2 ms 376 KB Output isn't correct
26 Runtime error 3 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Incorrect 3 ms 376 KB Output isn't correct
28 Runtime error 3 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 5 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Incorrect 2 ms 376 KB Output isn't correct
31 Incorrect 2 ms 256 KB Output isn't correct
32 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
33 Incorrect 2 ms 256 KB Output isn't correct
34 Incorrect 2 ms 256 KB Output isn't correct
35 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
36 Incorrect 2 ms 376 KB Output isn't correct
37 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
38 Runtime error 3 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
39 Incorrect 2 ms 376 KB Output isn't correct
40 Incorrect 2 ms 376 KB Output isn't correct