Submission #1005837

# Submission time Handle Problem Language Result Execution time Memory
1005837 2024-06-23T06:52:24 Z irmuun Highway Tolls (IOI18_highway) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
#include "highway.h"
 
using namespace std;
 
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()

void find_pair(int n,vector<int>u,vector<int>v,int A, int B){
    int m=u.size();
    vector<int>w(m,0);
    vector<pair<int,int>>adj[n];
    for(int i=0;i<m;i++){
        adj[u[i]].pb({v[i],i});
        adj[v[i]].pb({u[i],i});
    }
    ll C=ask(w);
    for(int t=1;t<n;t++){
        for(auto [_,i]:adj[t]){
            w[i]=1;
        }
        ll cost=ask(w);
        if(cost==C-a+b){
            answer(0,t);
            return;
        }
    }
    return;
}

Compilation message

highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, int, int)':
highway.cpp:27:20: error: 'a' was not declared in this scope
   27 |         if(cost==C-a+b){
      |                    ^
highway.cpp:27:22: error: 'b' was not declared in this scope
   27 |         if(cost==C-a+b){
      |                      ^