답안 #723954

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
723954 2023-04-14T14:08:28 Z victor_gao Vision Program (IOI19_vision) C++17
12 / 100
61 ms 7052 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],hs,Ws;
vector<int>q[2];
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[0].push_back(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[1].push_back(now);
		}
	}
	for (int i=0;i<n;i++){
		vector<int>qus;
		for (int j=i;j<min(n,i+k+1);j++){
			for (int l=0;l<m;l++)
				qus.push_back(j*m+l);
		}
		add_or(qus); now++;
		qus.push_back(now);
		add_xor(qus); now++;
		hs.push_back(now);
	}
	for (int i=0;i<m;i++){
		vector<int>qus;
		for (int j=i;j<min(m,i+k+1);j++)
			for (int l=0;l<n;l++)
				qus.push_back(l*m+j);
		add_or(qus); now++;
		qus.push_back(now);
		add_xor(qus); now++;
		Ws.push_back(now);
	}
	vector<int>qus;
	for (auto i:q[0])
		qus.push_back(i);
	for (auto i:q[1])
		qus.push_back(i);
	add_or(qus); now++;
	int have=now;
	qus.clear(); qus.push_back(have);
	add_or(hs); now++;
	qus.push_back(now);
	add_or(Ws); now++;
	qus.push_back(now);
	add_and(qus);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 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 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 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 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 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 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 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 452 KB Output is correct
2 Correct 4 ms 596 KB Output is correct
3 Correct 5 ms 572 KB Output is correct
4 Correct 4 ms 596 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
6 Correct 3 ms 468 KB Output is correct
7 Correct 4 ms 644 KB Output is correct
8 Correct 4 ms 596 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 3 ms 468 KB Output is correct
11 Correct 3 ms 596 KB Output is correct
12 Correct 5 ms 596 KB Output is correct
13 Correct 4 ms 596 KB Output is correct
14 Correct 4 ms 596 KB Output is correct
15 Correct 1 ms 452 KB Output is correct
16 Correct 4 ms 536 KB Output is correct
17 Correct 4 ms 596 KB Output is correct
18 Correct 6 ms 580 KB Output is correct
19 Correct 5 ms 576 KB Output is correct
20 Correct 4 ms 596 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 316 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 61 ms 7052 KB Output is correct
2 Incorrect 1 ms 212 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 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 -