Submission #682694

# Submission time Handle Problem Language Result Execution time Memory
682694 2023-01-16T19:39:53 Z APROHACK Vision Program (IOI19_vision) C++14
0 / 100
2 ms 976 KB
#include "vision.h"
#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
using namespace std;
int h, w, k;
bool valid(int x, int y){
	return (x < h && y < w && x >= 0 &&  y >= 0);
}
int coordenadasAPosicion (int x, int y){
	return x*w + y;
}


void construct_network(int H, int W, int K) {
	h = H, w = W, k = K;
	int cuenta = 0;
	vector<int>toOr;

	for(int i = 0 ; i < H ; i ++){
		for(int j = 0 ; j < W ; j ++){
			if(valid(i, j)){
				vector<int>toXor;
				for(int abajo = k ; abajo > -k ; abajo--){
					
					if(valid(i+abajo, j+k-abs(abajo))){
						toXor.pb(coordenadasAPosicion(i+abajo, j+k-abs(abajo)));
						//add_and({coordenadasAPosicion(i, j), coordenadasAPosicion(i+abajo, j+k-abs(abajo))});
						//cuenta ++;
					}
				}
				if(toXor.empty())continue;
				add_xor(toXor);
				add_not({H*W+cuenta});
				cuenta+=2;
				add_and({H*W+cuenta-1, coordenadasAPosicion(i, j)});
				cuenta++;
				toOr.pb({H*W+cuenta-1});

			}
		}
	}
	add_or(toOr);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 296 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
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 304 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -