Submission #802433

#TimeUsernameProblemLanguageResultExecution timeMemory
802433LiudasScales (IOI15_scales)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "scales.h"
using namespace std;
void orderCoins(){
    vector<int> arr(6);
    vector<int> b = {1,2,3,4,5,6};
    int ans = getHeaviest(1,2,3);
    ans = getHeaviest(ans, 4, 5);
    ans = getHeaviest(ans, 6, (ans == 5 ? 4 : 5));
    arr[5] = ans;
    b.erase(find(b.begin(), b.end(), ans));
    ans = getHeaviest(b[0], b[1], b[2]);
    ans = getHeaviest(ans, b[3], b[4]);
    b.erase(find(b.begin(), b.end(), ans));
    arr[4] = ans;
    ans = getLightest(b[0],b[1],b[2]);
    ans = getLightest(ans, b[3], arr[5]);
    b.erase(find(b.begin(), b.end(), ans));
    arr[0] = ans;
    ans = getHeaviest(b[0],b[1],b[2]);
    arr[3] = ans;
    int ans2 = getLightest(b[0],b[1],b[2]);
    arr[1] = ans2;
    b.erase(find(b.begin(), b.end(), ans));
    b.erase(find(b.begin(), b.end(), ans2));
    arr[2] = b[0];
    answer(arr);
}
void init(int T){
    for(int i = 0; i < T; i ++){
        orderCoins();
    }
}

Compilation message (stderr)

scales.cpp: In function 'void orderCoins()':
scales.cpp:27:12: error: cannot convert 'std::vector<int>' to 'int*'
   27 |     answer(arr);
      |            ^~~
      |            |
      |            std::vector<int>
In file included from scales.cpp:2:
scales.h:10:17: note:   initializing argument 1 of 'void answer(int*)'
   10 | void answer(int W[]);
      |             ~~~~^~~