Submission #395336

# Submission time Handle Problem Language Result Execution time Memory
395336 2021-04-28T08:39:59 Z irmuun Painting Walls (APIO20_paint) C++17
Compilation error
0 ms 0 KB
#include "paint.h"
#include<bits/stdc++.h>
using namespace std;
int a,b,c,d,e,i,j,k,be[100000],col[100000];
minimumInstructions(int N, int M, int K, vector <int> C, vector <int> A, vector < vector<int> > B){
  for(i=0;i<K;i++){
    be[i]=-1;
    col[i]=0;
  }
  for(i=0;i<M;i++){
    col[B[i][0]]=1;
    for(j=1;j<A[i];j++){
      be[B[i][j]]=B[i][j-1];
      col[B[i][j]]=1;
    }
  }
  d=1;
  for(i=0;i<N-1;i++){
    if(col[C[i]]==0){
      return -1;
    }
    if(be[C[i+1]]!=C[i]){
      d++;
    }
  }
  return d;
}

Compilation message

paint.cpp:5:98: error: ISO C++ forbids declaration of 'minimumInstructions' with no type [-fpermissive]
    5 | minimumInstructions(int N, int M, int K, vector <int> C, vector <int> A, vector < vector<int> > B){
      |                                                                                                  ^