Submission #395529

# Submission time Handle Problem Language Result Execution time Memory
395529 2021-04-28T12:54:15 Z ankhbayar06 Painting Walls (APIO20_paint) C++14
Compilation error
0 ms 0 KB
#include "paint.h"
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define mk make_pair

ll l,i,j,n,m,k,x,o[2000000],b[2000000],c[2000000],s,ans;
vector<int> a[200000];

int minimumInstructions (int N, int M, int K, std::vector< int> C, std::vector<int> A, std::vector< sdt::vector<int >> B){
	n=N;
	m=M;
	k=K;
	l=0;
	int sz=B.size();
	for(i=0 ; i<sz ; i++){
		if(A[l]>0){
			a[l].pb(b[i]);
			A[l]--;
		}
		else{
			l++;
		}
	}
	for(i=0 ; i<n ; i++){
		b[i]=1;
		for(l=0 ; l<m ; l++){
			k=1;
			sz=a[l].size();
			for(j=0 ; j<sz ; j++){
				if(a[l][j]==C[(i+l)%n])k=0;
			}
			if(k==1)b[i]=0;
		}
	}
	l=0;
	for(i=0 ; i<n ; i++){
		if(b[i]==0)l++;
		else{
			s=max(s,l);
			l=0;
		}
	}
	s=max(s,l);
	if(s>=m){
		return -1;
	}
	else{
		ans=0;
		l=0;
		for(i=0 ; i<n ; i+=0){
			if(b[i]==1)l=i;
			o[i]=l;
		}
		for(i=0 ; i<n ; i++){
			ans++;
			x=o[i];
			if(x+M-1<=i)return -1;
			i=x+m-1;
		}
		return ans;
	}
}


Compilation message

paint.cpp:13:101: error: 'sdt' was not declared in this scope; did you mean 'std'?
   13 | int minimumInstructions (int N, int M, int K, std::vector< int> C, std::vector<int> A, std::vector< sdt::vector<int >> B){
      |                                                                                                     ^~~
      |                                                                                                     std
paint.cpp:13:117: error: template argument 1 is invalid
   13 | int minimumInstructions (int N, int M, int K, std::vector< int> C, std::vector<int> A, std::vector< sdt::vector<int >> B){
      |                                                                                                                     ^~
paint.cpp:13:117: error: template argument 2 is invalid
paint.cpp:13:101: error: 'sdt' was not declared in this scope; did you mean 'std'?
   13 | int minimumInstructions (int N, int M, int K, std::vector< int> C, std::vector<int> A, std::vector< sdt::vector<int >> B){
      |                                                                                                     ^~~
      |                                                                                                     std
paint.cpp:13:117: error: template argument 1 is invalid
   13 | int minimumInstructions (int N, int M, int K, std::vector< int> C, std::vector<int> A, std::vector< sdt::vector<int >> B){
      |                                                                                                                     ^~
paint.cpp:13:117: error: template argument 2 is invalid
paint.cpp:13:101: error: 'sdt' was not declared in this scope; did you mean 'std'?
   13 | int minimumInstructions (int N, int M, int K, std::vector< int> C, std::vector<int> A, std::vector< sdt::vector<int >> B){
      |                                                                                                     ^~~
      |                                                                                                     std
paint.cpp:13:117: error: template argument 1 is invalid
   13 | int minimumInstructions (int N, int M, int K, std::vector< int> C, std::vector<int> A, std::vector< sdt::vector<int >> B){
      |                                                                                                                     ^~
paint.cpp:13:117: error: template argument 2 is invalid
paint.cpp:13:93: error: 'std::vector' is not a type
   13 | int minimumInstructions (int N, int M, int K, std::vector< int> C, std::vector<int> A, std::vector< sdt::vector<int >> B){
      |                                                                                             ^~~~~~
paint.cpp:13:99: error: expected ',' or '...' before '<' token
   13 | int minimumInstructions (int N, int M, int K, std::vector< int> C, std::vector<int> A, std::vector< sdt::vector<int >> B){
      |                                                                                                   ^
paint.cpp: In function 'int minimumInstructions(int, int, int, std::vector<int>, std::vector<int>, int)':
paint.cpp:18:9: error: 'B' was not declared in this scope
   18 |  int sz=B.size();
      |         ^