답안 #723918

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
723918 2023-04-14T12:58:52 Z victor_gao Vision Program (IOI19_vision) C++17
0 / 100
45 ms 5588 KB
#include "vision.h"
#include <bits/stdc++.h>
#define pii pair<int,int>
#define x first
#define y second
#define MAXN 205
using namespace std;
int n,m,k;
vector<int>ad[2*MAXN],ms[2*MAXN];
int q[2*MAXN][2],s[2*MAXN],l1[2*MAXN],l2[2*MAXN];
void construct_network(int H, int W, int K) {
	n=H; m=W; k=K;
	for (int i=0;i<n;i++){
		for (int j=0;j<m;j++){
			ad[i+j].push_back(i*m+j);
			ms[i-j+m-1].push_back(i*m+j);
		}
	}
	int now=n*m-1;
	for (int i=0;i<=n+m-2;i++){
		vector<int>qus;
		if (i+k<=n+m-2){
			for (auto j:ad[i]) qus.push_back(j);
			for (auto j:ad[i+k]) qus.push_back(j);
			add_or(qus); now++;
			qus.push_back(now);
			add_xor(qus); now++;
			q[i][0]=now;
		}
	}
	for (int i=0;i<=n+m-2;i++){
		vector<int>qus;
		qus=ad[i];
		add_or(qus); now++;
		qus=ad[i]; qus.push_back(now);
		add_xor(qus); now++;
	}
	for (int i=0;i<=n+m-2;i++){
		vector<int>qus;
		if (i+k<=n+m-2){
			for (auto j:ms[i]) qus.push_back(j);
			for (auto j:ms[i+k]) qus.push_back(j);
			add_or(qus); now++;
			qus.push_back(now);
			add_xor(qus); now++;
			q[i][1]=now;
		}
	}
	for (int i=0;i<=n+m-2;i++){
		vector<int>qus;
		qus=ms[i];
		add_or(qus); now++;
		qus=ms[i]; qus.push_back(now);
		add_xor(qus); now++;
	}
	for (int i=0;i<k;i++){
		vector<int>qus;
		for (int j=i;j<n+m;j+=k){
			if (q[i][1])
				qus.push_back(q[i][1]);
		}
		if (qus.empty()) continue;
		add_or(qus); now++;
		s[i]=now;
	}
	vector<int>ans;
	for (int i=0;i<=n+m-2;i++){
		vector<int>qus;
		if (!q[i][0]) continue;
		qus.push_back(q[i][0]);
		for (int j=0;j<k;j++)
			if (s[j]) qus.push_back(s[j]);
		add_or(qus); now++;
		ans.push_back(now);
	}
	vector<int>qus;
	for (auto i:ans)
		qus.push_back(i);
	add_or(qus); now++;
	int have1=now;
	if (k%2==0){
		qus.clear();
		for (int i=0;i<=n+m-2;i++){
			qus.push_back(l1[i]);
			qus.push_back(l2[i]);
		}
		add_or(qus); now++;
		int have2=now;
		add_and({have1,have2});
	}
	/*
	for (int i=0;i<n+m;i++){
		cout<<"q : "<<q[i][0]<<" "<<q[i][1]<<"\n";
	}
	for (int i=0;i<n+m;i++)
		cout<<s[i]<<" ";
	cout<<'\n';
	for (auto i:ans)
		cout<<i<<" ";
	cout<<'\n';
	*/
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 468 KB Output is correct
2 Correct 2 ms 468 KB Output is correct
3 Incorrect 2 ms 468 KB on inputs (0, 1), (0, 101), expected 1, but computed 0
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 45 ms 5588 KB on inputs (96, 130), (143, 84), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -