Submission #285185

# Submission time Handle Problem Language Result Execution time Memory
285185 2020-08-28T11:31:59 Z peti1234 Highway Tolls (IOI18_highway) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "highway.h"
using namespace std;
const int c=90002;
long long m, dist, xo, s, kul, ert[c], cnt, cs1, cs2;;
bool v[c];
vector<int> sz;
void find_pair(int n, vector<int> x, vector<int> y, long long gy, long long e) {
    m=x.size(), sz.resize(m);
    for (int i=0; i<m; i++) sz[i]=0;
    dist=ask(sz);
    for (int i=0; i<18; i++) {
        for (int j=0; j<m; j++) {
            if (x[j]&(1<<i)==(y[j]&(1<<i))) sz[i]=0;
            else sz[i]=1;
        }
        s=ask(sz);
        kul=(s-dist)/(e-gy);
        if (kul%2) xo+=(1<<i);
    }
    for (int i=0; i<n; i++) {
        int f=(i^xo);
        if (!v[i] && f<n && !v[f]) v[i]=1, v[f]=1, cnt++, ert[i]=cnt;
    }
    for (int i=0; i<18; i++) {
        for (int j=0; j<m; j++) {
            if (ert[x[j]&(1<<i)]==ert[y[j]&(1<<i)]) sz[i]=0;
            else sz[i]=1;
        }
        s=ask(sz);
        kul=(s-dist)/(e-gy);
        if (kul%2) cs1+=(1<<i);
    }
    cs2=(cs1^xo);
    answer(cs1, cs2);
}

Compilation message

highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, long long int, long long int)':
highway.cpp:14:28: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   14 |             if (x[j]&(1<<i)==(y[j]&(1<<i))) sz[i]=0;
      |                      ~~~~~~^~~~~~~~~~~~~~~
/tmp/cc7HHkgC.o: In function `main':
grader.cpp:(.text.startup+0x11c): undefined reference to `find_pair(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, int, int)'
collect2: error: ld returned 1 exit status