Submission #828830

# Submission time Handle Problem Language Result Execution time Memory
828830 2023-08-17T16:58:27 Z Baytoro Vision Program (IOI19_vision) C++17
0 / 100
1 ms 1108 KB
#include "vision.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
#define pb push_back
#define fr first
#define sc second
using namespace std;
void construct_network(int H, int W, int K) {
	vector<int> a,b;	
	for(int i=0;i<H;i++){
		vector<int> v;
		for(int j=0;j<W;j++){
			v.pb(i*W+j);
		}
		if(add_or(v)) a.pb(i);
	}
	for(int j=0;j<W;j++){
		vector<int> v;
		for(int i=0;i<H;i++){
			v.pb(i*W+j);
		}
		if(add_or(v)) b.pb(j);
	}
	int x1=-1,x2=-1,y1=-1,y2=-1;
	if(a.size()==2){
		int l=0,r=W-1;
		while(l<r){
			int md=(l+r)/2;
			vector<int> v;
			for(int i=l;i<=md;i++){
				v.pb(a[0]*W+i);
			}
			if(add_or(v)) r=md;
			else l=md+1;
		}
		x1=a[0],y1=l;
		l=0,r=W-1;
		while(l<r){
			int md=(l+r)/2;
			vector<int> v;
			for(int i=l;i<=md;i++){
				v.pb(a[1]*W+i);
			}
			if(add_or(v)) r=md;
			else l=md+1;
		}
		x2=a[1],y2=l;
	}
	else if(b.size()==2){
		a=b;
		int l=0,r=H-1;
		while(l<r){
			int md=(l+r)/2;
			vector<int> v;
			for(int i=l;i<=md;i++){
				v.pb(i*W+a[0]);
			}
			if(add_or(v)) r=md;
			else l=md+1;
		}
		x1=l,y1=a[0];
		l=0,r=H-1;
		while(l<r){
			int md=(l+r)/2;
			vector<int> v;
			for(int i=l;i<=md;i++){
				v.pb(i*W+a[1]);
			}
			if(add_or(v)) r=md;
			else l=md+1;
		}
		x2=l,y2=a[1];
	}
	assert(x1!=-1);
	if(abs(x2-x1)+abs(y2-y1)==K) add_or({x1*W+y1});
	else add_not({x1*W+y1});
}
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 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 Runtime error 1 ms 1108 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -