Submission #796888

# Submission time Handle Problem Language Result Execution time Memory
796888 2023-07-28T21:51:39 Z Lobo Vision Program (IOI19_vision) C++17
0 / 100
2 ms 976 KB
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fr first
#define sc second
#define mp make_pair
#define all(x) x.begin(),x.end()

void construct_network(int n, int m, int k) {
	// std::vector<int> Ns;
	// Ns = {0, 1};
	// int a = add_and(Ns);
	// Ns = {0, a};
	// int b = add_or(Ns);
	// Ns = {0, 1, b};
	// int c = add_xor(Ns);
	// add_not(c);

	vector<pair<int,int>> wtf = {{1,1},{1,-1},{-1,1},{-1,-1}};

	int last = n*m-1;

	// for(int i = 0; i < n; i++) {
	// 	for(int j = 0; j < m; j++) {
	// 		for(int ii = 0; ii < n; ii++) {
	// 			for(int jj = 0; jj < m; jj++) {
	// 				if(abs(i-ii)+abs(j-jj) == k && i*m+j < ii*m+jj) {
	// 					last = add_and(vector<int>{i*m+j,ii*m+jj});
	// 				}
	// 			}
	// 		}
	// 	}
	// }


	vector<int> checks;
	for(int i = 0; i < n; i++) {
		for(int j = 0; j < m; j++) {
			vector<int> valid_pos;
			for(int d1 = 0; d1 <= k; d1++) {
				for(auto X : wtf) {
					int ii = i+d1*X.fr;
					if(d1 == 0 && X.fr == -1) continue;
					int jj = j+(k-d1)*X.sc;
					if((k-d1) == 0 && X.sc == -1) continue;

					if(ii >= 0 && ii < n && jj >= 0 && jj < m && i*m+j < ii*m+jj) {
						// last = add_and(vector<int>{i*m+j,ii*m+jj});
						valid_pos.pb(ii*m+jj);
					}
				}
			}

			int or_valid_pos = add_or(valid_pos);
			checks.pb(add_and(vector<int>{i*m+j,or_valid_pos}));
		}
	}
	add_or(checks);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:22:6: warning: unused variable 'last' [-Wunused-variable]
   22 |  int last = n*m-1;
      |      ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 976 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -