Submission #97493

# Submission time Handle Problem Language Result Execution time Memory
97493 2019-02-16T12:33:36 Z wilwxk Scales (IOI15_scales) C++11
0 / 100
4 ms 640 KB
#include "scales.h"
#include <bits/stdc++.h>
using namespace std;


void init(int t) {
    mt19937 rng(time(0)+t);
}

void orderCoins() {
    int respf[6]={1, 2, 3, 4, 5, 6};
    vector<int> resp;
    int v[]={0, 1, 2, 3, 4, 5, 6};
    random_shuffle(v+1, v+6);
    int a, b;

    a=getLightest(v[1], v[2], v[3]);
    if(v[2]==a) swap(v[1], v[2]);
    if(v[3]==a) swap(v[1], v[3]);
    a=getMedian(v[1], v[2], v[3]);
    if(v[3]==a) swap(v[2], v[3]);

    a=getLightest(v[4], v[5], v[6]);
    if(v[5]==a) swap(v[4], v[5]);
    if(v[6]==a) swap(v[4], v[6]);
    a=getMedian(v[4], v[5], v[6]);
    if(v[6]==a) swap(v[5], v[6]);

    int p=1;
    for(int i=4; i<=6; i++) {
        int cara=getNextLightest(v[1], v[2], v[3], v[i]);
        while(v[p]!=cara) resp.push_back(v[p++]);
        resp.push_back(v[i]);
    }
    while(p!=4) resp.push_back(v[p++]);
    for(int i=0; i<6; i++) respf[i]=resp[i];
    answer(respf);
}

Compilation message

In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (_ghksjhdfkae19ga_ > 1) 
     ^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (i = 0; i < 6; i++) {
  ^~~
scales.cpp: In function 'void orderCoins()':
scales.cpp:15:12: warning: unused variable 'b' [-Wunused-variable]
     int a, b;
            ^
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 3 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 3 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 4 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 3 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 4 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 2 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 3 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Incorrect 4 ms 128 KB Output isn't correct
10 Runtime error 3 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 4 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 3 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 4 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Incorrect 2 ms 384 KB Output isn't correct
15 Incorrect 3 ms 384 KB Output isn't correct
16 Runtime error 4 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 4 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Incorrect 2 ms 256 KB Output isn't correct
19 Runtime error 3 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 3 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 3 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 3 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Incorrect 2 ms 256 KB Output isn't correct
24 Runtime error 4 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 3 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Incorrect 2 ms 260 KB Output isn't correct
27 Runtime error 3 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Incorrect 2 ms 256 KB Output isn't correct
29 Incorrect 2 ms 512 KB Output isn't correct
30 Incorrect 2 ms 384 KB Output isn't correct
31 Runtime error 3 ms 512 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Runtime error 4 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
33 Incorrect 4 ms 512 KB Output isn't correct
34 Runtime error 3 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
35 Runtime error 3 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
36 Runtime error 2 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Incorrect 2 ms 384 KB Output isn't correct
38 Incorrect 3 ms 256 KB Output isn't correct
39 Runtime error 3 ms 384 KB Execution killed with signal 11 (could be triggered by violating memory limits)
40 Incorrect 2 ms 256 KB Output isn't correct