Submission #1165189

#TimeUsernameProblemLanguageResultExecution timeMemory
1165189SmuggingSpunScales (IOI15_scales)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "scales.h"
using namespace std;
void init(int T){
}
void orderCoins(){
    vector<int>p = {1, 2, 3, 4, 5, 6}, ans;
    while(p.size() > 2){
        int light = getLightest(p[0], p[1], p[2]);
        ans.emplace_back(light);
        p.erase(find(p.begin(), p.end(), light));
    }
    int heavy = getHeaviest(p[0], p[1], ans[0]);
    ans.emplace_back(p[0] ^ p[1] ^ heavy);
    ans.emplace_back(heavy);
    answer(ans);
}

Compilation message (stderr)

scales.cpp: In function 'void orderCoins()':
scales.cpp:16:12: error: cannot convert 'std::vector<int>' to 'int*'
   16 |     answer(ans);
      |            ^~~
      |            |
      |            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[]);
      |             ~~~~^~~