제출 #263192

#제출 시각아이디문제언어결과실행 시간메모리
263192salma통행료 (IOI18_highway)C++14
컴파일 에러
0 ms0 KiB
#include "highway.h"
#include<bits/stdc++.h>
using namespace std;

void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B) {
  int M = U.size();

    std::vector<int> w(M);
    map<int,int>a;
    for (int i = 0; i < M; ++i) {
      w[i] = 0;
    }
    long long toll = ask(w);
    int cnt = toll/A;

    for(int i=0;i<N;i++){
        if(cnt == 0)break;
        w[i]=1;
        if(toll != ask(w)){
            a[V[i]]++;
            a[U[i]]++;
            cnt--;
        }
        w[i]=0;
    }
    map<int,int>::iterator it = m.begin();
    int ans1=-1 , ans2=-1;
    for(;it!=m.end();it++){
        if(it->second == 1){
            if(ans1==-1)ans1=it->first;
            else{
                ans2 = it->first;
                break;
            }
        }
    }
  answer(ans1 , ans2);
}

컴파일 시 표준 에러 (stderr) 메시지

highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, int, int)':
highway.cpp:26:33: error: 'm' was not declared in this scope
   26 |     map<int,int>::iterator it = m.begin();
      |                                 ^