Submission #825613

# Submission time Handle Problem Language Result Execution time Memory
825613 2023-08-15T06:21:17 Z tomruk Vision Program (IOI19_vision) C++17
0 / 100
9 ms 1352 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

void construct_network(int H, int W, int K){
	vector<int> ans;
	vector<int> a(H+W-1);
	vector<int> b(H+W-1);
	for(int i = 0;i<H+W-1;i++){
		vector<int> v1,v2;
		for(int x = 0;x<H;x++){
			int y = i - x;
			if(0 <= y && y < W)
				v1.push_back(x * W + y);
			y = -(i - (W-1) - x);
			if(0 <= y && y < W)
				v2.push_back(x * W + y);
		}
		a[i] = add_or(v1);
		b[i] = add_or(v2);
	}
	int pos0 = add_and({0,add_not(0)});
	for(int k = K-1;k<=K;k++){
		int now = -1;
		vector<int> tmp;
		tmp.push_back(pos0);
		int cnt = 0;
		for(int j = H+W-k-3;j>=0;j--){
			if(now == -1){
				now = a[H+W-k-2-cnt];
			}
			else{
				now = add_or({now,a[H+W-k-2-cnt]});
			}
			tmp.push_back(add_and({a[j],now}));
			cnt++;
		}
		int pos1 = add_or(tmp);
		now = -1;
		tmp.clear();
		tmp.push_back(pos0);
		cnt = 0;
		for(int j = H+W-k-3;j>=0;j--){
			if(now == -1){
				now = b[H+W-k-2-cnt];
			}
			else{
				now = add_or({now,b[H+W-k-2-cnt]});
			}
			tmp.push_back(add_and({b[j],now}));
			cnt++;
		}
		pos1 = add_or({pos1,add_or(tmp)});
		ans.push_back(add_not(pos1));
	}
	add_xor(ans);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 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 212 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 212 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 212 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 340 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 212 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 9 ms 1352 KB on inputs (80, 199), (81, 199), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -