Submission #133795

# Submission time Handle Problem Language Result Execution time Memory
133795 2019-07-21T11:39:03 Z Runtime_error_ Scales (IOI15_scales) C++14
19.5326 / 100
2 ms 504 KB
#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
int mn = 1;

void init(int T) {

}

bool cmp(int x,int y){

    int tmp = getHeaviest(mn,x,y);
    return (tmp == y);
}

void orderCoins() {
    int W[] = {1, 2, 3, 4, 5, 6};
    int x = getLightest(1,2,3) , y = getLightest(4,5,6),z;
    for(int i=1;i<=6;i++)
        if(i != x && i != y)
            z = i;

    mn = getLightest( x,y,z );
    for(int i=1;i<6;i++)
        if(W[i] == mn)
            swap(W[i],W[0]);

    sort(W+1,W+6,cmp);
    answer(W);
    return ;
}

Compilation message

scales.cpp: In function 'void init(int)':
scales.cpp:6:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'void orderCoins()':
scales.cpp:23:21: warning: 'z' may be used uninitialized in this function [-Wmaybe-uninitialized]
     mn = getLightest( x,y,z );
          ~~~~~~~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 256 KB Output is partially correct
2 Partially correct 2 ms 376 KB Output is partially correct
3 Partially correct 2 ms 376 KB Output is partially correct
4 Partially correct 2 ms 256 KB Output is partially correct
5 Partially correct 2 ms 376 KB Output is partially correct
6 Partially correct 2 ms 376 KB Output is partially correct
7 Partially correct 2 ms 376 KB Output is partially correct
8 Partially correct 2 ms 376 KB Output is partially correct
9 Partially correct 2 ms 256 KB Output is partially correct
10 Partially correct 2 ms 376 KB Output is partially correct
11 Partially correct 2 ms 376 KB Output is partially correct
12 Partially correct 2 ms 376 KB Output is partially correct
13 Partially correct 2 ms 376 KB Output is partially correct
14 Partially correct 2 ms 256 KB Output is partially correct
15 Partially correct 2 ms 376 KB Output is partially correct
16 Partially correct 2 ms 256 KB Output is partially correct
17 Partially correct 2 ms 256 KB Output is partially correct
18 Partially correct 2 ms 376 KB Output is partially correct
19 Partially correct 2 ms 252 KB Output is partially correct
20 Partially correct 2 ms 256 KB Output is partially correct
21 Partially correct 2 ms 256 KB Output is partially correct
22 Partially correct 2 ms 376 KB Output is partially correct
23 Partially correct 2 ms 376 KB Output is partially correct
24 Partially correct 2 ms 376 KB Output is partially correct
25 Partially correct 2 ms 376 KB Output is partially correct
26 Partially correct 2 ms 376 KB Output is partially correct
27 Partially correct 2 ms 256 KB Output is partially correct
28 Partially correct 2 ms 256 KB Output is partially correct
29 Partially correct 2 ms 376 KB Output is partially correct
30 Partially correct 2 ms 380 KB Output is partially correct
31 Partially correct 2 ms 256 KB Output is partially correct
32 Partially correct 2 ms 376 KB Output is partially correct
33 Partially correct 2 ms 256 KB Output is partially correct
34 Partially correct 2 ms 256 KB Output is partially correct
35 Partially correct 2 ms 376 KB Output is partially correct
36 Partially correct 2 ms 376 KB Output is partially correct
37 Partially correct 2 ms 376 KB Output is partially correct
38 Partially correct 2 ms 504 KB Output is partially correct
39 Partially correct 2 ms 376 KB Output is partially correct
40 Partially correct 2 ms 252 KB Output is partially correct