Submission #936783

# Submission time Handle Problem Language Result Execution time Memory
936783 2024-03-02T17:28:32 Z PagodePaiva Scales (IOI15_scales) C++17
0 / 100
1 ms 348 KB
#include<bits/stdc++.h>
#include "scales.h"
#define getLightiest getLightest

using namespace std;

void init(int T) {
    // cout << T << endl;
    return;
}

void orderCoins() {
    int x = getHeaviest(1, 2, 3);
    int y = getLightiest(4, 5, 6);
    vector <int> maior, menor;
    for(int i = 1;i <= 3;i++){
        if(i == x) maior.push_back(i);
        else menor.push_back(i);
    }  
    for(int i = 4;i <= 6;i++){
        if(i == y) menor.push_back(i);
        else maior.push_back(i);
    }
    x = getHeaviest(maior[0], maior[1], maior[2]);
    y = getLightiest(menor[0], menor[1], menor[2]);
    int res[6];
    res[0] = y;
    res[5] = x;
    vector <int> v;
    for(auto a : maior){
        if(a != x) v.push_back(a);
    }
    for(auto a : menor){
        if(a != y) v.push_back(a);
    }
    int mn = getLightiest(v[0], v[1], v[2]);
    int id = (mn == v[0] ? 0 : (mn == v[1] ? 1 : 2));
    mn = getLightiest(v[id], v[(id+1) % 4], v[(id+2) % 4]);
    vector <int> tr;
    for(auto a : v){
        if(a == mn) continue;
        tr.push_back(a);
    }
    res[1] = mn;
    x = getLightiest(tr[0], tr[1], tr[2]);
    res[2] = x;
    res[3] = getMedian(tr[0], tr[1], tr[2]);
    for(auto a : tr){
        if(a == res[3] or a == res[2]) continue;
        res[4] = a;
    }
    answer(res);
    return;
}

Compilation message

scales.cpp: In function 'void init(int)':
scales.cpp:7:15: warning: unused parameter 'T' [-Wunused-parameter]
    7 | void init(int T) {
      |           ~~~~^
# Verdict Execution time Memory Grader output
1 Partially correct 0 ms 344 KB Output is partially correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Partially correct 0 ms 348 KB Output is partially correct
6 Partially correct 0 ms 348 KB Output is partially correct
7 Incorrect 0 ms 344 KB Output isn't correct
8 Partially correct 1 ms 348 KB Output is partially correct
9 Partially correct 1 ms 348 KB Output is partially correct
10 Incorrect 0 ms 348 KB Output isn't correct
11 Incorrect 0 ms 344 KB Output isn't correct
12 Incorrect 0 ms 348 KB Output isn't correct
13 Incorrect 0 ms 348 KB Output isn't correct
14 Partially correct 0 ms 348 KB Output is partially correct
15 Incorrect 1 ms 348 KB Output isn't correct
16 Incorrect 0 ms 348 KB Output isn't correct
17 Incorrect 0 ms 348 KB Output isn't correct
18 Incorrect 1 ms 348 KB Output isn't correct
19 Partially correct 0 ms 348 KB Output is partially correct
20 Incorrect 1 ms 344 KB Output isn't correct
21 Incorrect 0 ms 348 KB Output isn't correct
22 Incorrect 0 ms 348 KB Output isn't correct
23 Incorrect 0 ms 348 KB Output isn't correct
24 Incorrect 0 ms 348 KB Output isn't correct
25 Incorrect 0 ms 348 KB Output isn't correct
26 Incorrect 0 ms 348 KB Output isn't correct
27 Incorrect 0 ms 348 KB Output isn't correct
28 Incorrect 0 ms 348 KB Output isn't correct
29 Incorrect 1 ms 348 KB Output isn't correct
30 Partially correct 0 ms 348 KB Output is partially correct
31 Incorrect 0 ms 348 KB Output isn't correct
32 Incorrect 0 ms 348 KB Output isn't correct
33 Partially correct 0 ms 348 KB Output is partially correct
34 Partially correct 0 ms 348 KB Output is partially correct
35 Partially correct 0 ms 348 KB Output is partially correct
36 Incorrect 0 ms 348 KB Output isn't correct
37 Partially correct 0 ms 344 KB Output is partially correct
38 Incorrect 0 ms 348 KB Output isn't correct
39 Incorrect 0 ms 348 KB Output isn't correct
40 Incorrect 1 ms 348 KB Output isn't correct