Submission #257705

# Submission time Handle Problem Language Result Execution time Memory
257705 2020-08-04T15:09:35 Z a_player Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include "vision.h"
#include <bits/stdc++.h>

using namespace std;

void construct_network(int H, int W, int K) {
	int cont=H*W;
	vector<int> s(2);
	for(int i=0;i<H*W;i++)
	for(int j=i+1;j<H*W;j++){
		if(abs(i/W-j/W)+abs(i%W-j%W)==K){
			s[0]=i;
			s[1]=j;
			add_and(s);
			cont++;
		}
	}
	}
	vector<int> v;
	for(int i=H*W;i<cont;i++)v.push_back(i);
	add_or(v);
}

Compilation message

vision.cpp:20:2: error: expected unqualified-id before 'for'
  for(int i=H*W;i<cont;i++)v.push_back(i);
  ^~~
vision.cpp:20:16: error: 'i' does not name a type
  for(int i=H*W;i<cont;i++)v.push_back(i);
                ^
vision.cpp:20:23: error: 'i' does not name a type
  for(int i=H*W;i<cont;i++)v.push_back(i);
                       ^
vision.cpp:21:8: error: expected constructor, destructor, or type conversion before '(' token
  add_or(v);
        ^
vision.cpp:22:1: error: expected declaration before '}' token
 }
 ^