Submission #802431

#TimeUsernameProblemLanguageResultExecution timeMemory
802431LiudasScales (IOI15_scales)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "scales.h"
using namespace std;
int getHeaviest(int a, int b, int c){
    int d;
    cout<< a << " " << b << " " << c << endl;
    cin >> d;
    return d;
}
int getLightest(int a, int b, int c){
    int d;
    cout<< a << " " << b << " " << c << endl;
    cin >> d;
    return d;
}
void answer(vector<int> a){
    for(int i : a){
        cout << i <<" ";
    }
    cout << endl;
}
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)

/usr/bin/ld: /tmp/ccDxWy1O.o: in function `getHeaviest':
scales.cpp:(.text+0xb0): multiple definition of `getHeaviest'; /tmp/cc1hsOLP.o:grader.c:(.text+0x180): first defined here
/usr/bin/ld: /tmp/ccDxWy1O.o: in function `getLightest':
scales.cpp:(.text+0x1d0): multiple definition of `getLightest'; /tmp/cc1hsOLP.o:grader.c:(.text+0x240): first defined here
collect2: error: ld returned 1 exit status