Submission #316810

# Submission time Handle Problem Language Result Execution time Memory
316810 2020-10-28T05:49:23 Z tengiz05 Vision Program (IOI19_vision) C++17
0 / 100
12 ms 1792 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> dl[405], dr[405];
int dgl[405], dgr[405], prl[405], prr[405];
int h, w;
int pos(int i, int j){
	return i*w+j;
}
void construct_network(int n, int m, int k) {
	h=n, w=m;
	vector<int> vec1, vec2;
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			dl[i+j].push_back(pos(i, j));
			dr[i-j+m-1].push_back(pos(i, j));
		}
	}
	for(int i=0;i<=n+m-2;i++){
		dgl[i] = add_or(dl[i]);
		dgr[i] = add_or(dr[i]);
		if(i == 0){
			prl[i] = add_or({dgl[i]});
			prr[i] = add_or({dgr[i]});
		}else {
			prl[i] = add_or({prl[i-1], dgl[i]});
			prr[i] = add_or({prr[i-1], dgr[i]});
		}
		if(i >= k){
			vec1.push_back(add_and({dgl[i], prl[i-k]}));
			vec1.push_back(add_and({dgr[i], prr[i-k]}));
		}if(i >= k+1){
			vec2.push_back(add_and({dgr[i], prl[i-k-1]}));
			vec2.push_back(add_and({dgr[i], prr[i-k-1]}));
		}
	}if(k == n+m-2){
		add_or(vec1);
	}else {
		add_xor({add_or(vec1), add_or(vec2)});
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 512 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 1792 KB on inputs (126, 120), (176, 169), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -