Submission #1124930

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11249302024-12-07 15:48:57PacybwoahHighway Tolls (IOI18_highway)C++20
Compilation error
0 ms0 KiB
#include "highway.h"
#include<iostream>
#include<vector>
#include<algorithm>
#include<cassert>
#include<utility>
using namespace std;
typedef long long ll;
namespace{
int n, m;
}
void find_pair(int N, std::vector<int> U, std::vector<int> V, int A, int B){
n = N;
m = (int)U.size();
vector<vector<pair<int, int>>> graph(n);
for(int i = 0; i < m; i++){
graph[U[i]].emplace_back(V[i], i);
graph[V[i]].emplace_back(U[i], i);
}
vector<int> que(m);
ll len = ask(que);
auto reset = [&](){
for(int i = 0; i < m; i++) que[i] = 0;
};
int l = 0, r = m - 1;
while(l < r){
int mid = (l + r) >> 1;
reset();
for(int i = 0; i <= mid; i++) que[i] = 1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

highway.cpp: In function 'void find_pair(int, std::vector<int>, std::vector<int>, int, int)':
highway.cpp:40:5: error: 'queue' was not declared in this scope
   40 |     queue<int> q;
      |     ^~~~~
highway.cpp:6:1: note: 'std::queue' is defined in header '<queue>'; did you forget to '#include <queue>'?
    5 | #include<cassert>
  +++ |+#include <queue>
    6 | #include<utility>
highway.cpp:40:11: error: expected primary-expression before 'int'
   40 |     queue<int> q;
      |           ^~~
highway.cpp:41:5: error: 'q' was not declared in this scope
   41 |     q.push(u);
      |     ^