Submission #263201

#TimeUsernameProblemLanguageResultExecution timeMemory
263201NicolaAbusaad2014Highway Tolls (IOI18_highway)C++14
Compilation error
0 ms0 KiB
#include "highway.h" #include <bits/stdc++.h> using namespace std; map<int,int>m; vector<int>v; void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) { int M = (int)U.size(); vector<int> w(M); for (int i = 0; i < M; ++i) { w[i] = 0; } long long mn=ask(w); w.clear(); for (int j = 0; j < M; ++j) { std::vector<int> w(M); for (int i = 0; i < M; ++i) { w[i] = 0; if(i==j){ w[i]=1; } } long long toll = ask(w); if(toll>mn){ v.push_back(U[j]); v.push_back(V[j]); m[V[j]]++; m[U[j]]++; } } vector<int>ans; for(long i=0;i<v.size();i++){ if(m[v[i]]==1){ ans.push_back(v[i]); } answer(ans[0], ans[1]); }

Compilation message (stderr)

highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, int, int)':
highway.cpp:31:17: warning: comparison of integer expressions of different signedness: 'long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |   for(long i=0;i<v.size();i++){
      |                ~^~~~~~~~~
highway.cpp:36:1: error: expected '}' at end of input
   36 | }
      | ^
highway.cpp:6:77: note: to match this '{'
    6 | void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
      |                                                                             ^