Submission #837265

# Submission time Handle Problem Language Result Execution time Memory
837265 2023-08-25T08:53:27 Z Trumling Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std; 

typedef long long ll;
#define pb push_back
#define F first
#define S second
#define enter cout<<'\n';
#define INF 99999999999999999
#define MOD 1000000007
#define all(x) x.begin(),x.end()

void construct_network(int H, int W, int K) 
{
	vector<int>Ns;
	ll idx=0;
	for(int i=0;i<H;i++)
		for(int j=0;j<W;j++)
			{
				int curr=K;
				while(curr>=0)
				{
					if(j+curr>=W || i+(K-curr)>=H)
					{
						curr--;
						continue;
					}
	
					add_and({W*i+j,W*(i+K-curr)+j+curr});
					idx++;
					curr--;
				}
				int curr=1;
				while(curr<K)
				{
					if(j-curr<0 || i+(K-curr)>=H)
					{
						curr--;
						continue;
					}

					add_and({W*i+j,W*(i+K-curr)+j-curr});
					idx++;
					curr++;
				}
			}
	vector<int>ans;
	for(int i=W*H;i<W*H+idx;i++)
	ans.pb(i);

	add_or(ans);
		
		
		
		
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:34:9: error: redeclaration of 'int curr'
   34 |     int curr=1;
      |         ^~~~
vision.cpp:21:9: note: 'int curr' previously declared here
   21 |     int curr=K;
      |         ^~~~