Submission #538518

# Submission time Handle Problem Language Result Execution time Memory
538518 2022-03-17T03:46:49 Z abcdehello Vision Program (IOI19_vision) C++17
Compilation error
0 ms 0 KB
#include <vision.h>
// TODO: declare global variables here
using namespace std;
vector <int> ld[401],rd[401],lor,ror,lp,rp,ans;
void precalc(int H,int W){
	for (int i=0;i<H;i++){
		for (int j=0;j<W;j++){
			ld[i+j].push_back(i*W+j);
			rd[i-j+W-1].push_back(i*W+j);
		}
	}
	for (int i=0;i<=H+W-2;i++){
		lor.push_back(add_or(ld[i]));
		ror.push_back(add_or(rd[i]));
		lp.push_back(add_or(lor));
		rp.push_back(add_or(ror));
	}
	//cerr << "***" << endl;
}
int calc(int H,int W,int K){
	vector <int> res;
	for (int i=0;i<=H+W-2;i++){
		if (i>=K){
			res.push_back(add_and({lor[i],lp[i-K]}));
			res.push_back(add_and({ror[i],rp[i-K]}));
		}
	}
	//cerr << "***" << endl;
	return add_or(res);
}
void construct_network(int H, int W, int K) {
	precalc(H,W);
	ans.push_back(calc(H,W,K));
	if (H+W-2<K) ans.push_back(calc(H,W,K+1));
	add_xor(ans);
}

int main() {
	std::ios::sync_with_stdio(false); std::cin.tie(0);
	int H, W, K;
	std::cin >> H >> W >> K;
	instructionNetwork.init(H, W);
	construct_network(H, W, K);
	return 0;
}

Compilation message

vision.cpp: In function 'int main()':
vision.cpp:39:12: error: incomplete type 'std::ios' {aka 'std::basic_ios<char>'} used in nested name specifier
   39 |  std::ios::sync_with_stdio(false); std::cin.tie(0);
      |            ^~~~~~~~~~~~~~~
vision.cpp:39:41: error: 'cin' is not a member of 'std'
   39 |  std::ios::sync_with_stdio(false); std::cin.tie(0);
      |                                         ^~~
vision.cpp:2:1: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
    1 | #include <vision.h>
  +++ |+#include <iostream>
    2 | // TODO: declare global variables here
vision.cpp:41:7: error: 'cin' is not a member of 'std'
   41 |  std::cin >> H >> W >> K;
      |       ^~~
vision.cpp:41:7: note: 'std::cin' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
vision.cpp:42:2: error: 'instructionNetwork' was not declared in this scope; did you mean 'construct_network'?
   42 |  instructionNetwork.init(H, W);
      |  ^~~~~~~~~~~~~~~~~~
      |  construct_network