Submission #835612

#TimeUsernameProblemLanguageResultExecution timeMemory
835612ma_moutahidThousands Islands (IOI22_islands)C++17
Compilation error
0 ms0 KiB
#include "islands.h"

#include <variant>
#include <vector>
#include<bits/stdc++.h>

using namespace std;

std::variant<bool, std::vector<int>> find_journey(
    int N, int M, std::vector<int> U, std::vector<int> V) {
  int a=0,b=-1;
  pair<int,int>p;
  for(int i=0;i<M;i++){
    if(u[i]=0){
      if(a>=2)continue;
      if(a==1)p.second=i;
      else p.first=i;
      a++;
    }
    else {
      b=i;
    }
  }
  if (b!=-1 && a>=2) {
    return std::vector<int>({p.first,b,p.second,p.first,b,p.second});
  }
  return false;
}
     

Compilation message (stderr)

islands.cpp: In function 'std::variant<bool, std::vector<int, std::allocator<int> > > find_journey(int, int, std::vector<int>, std::vector<int>)':
islands.cpp:14:8: error: 'u' was not declared in this scope
   14 |     if(u[i]=0){
      |        ^