제출 #825613

#제출 시각아이디문제언어결과실행 시간메모리
825613tomrukVision Program (IOI19_vision)C++17
0 / 100
9 ms1352 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...