Submission #398590

# Submission time Handle Problem Language Result Execution time Memory
398590 2021-05-04T15:08:11 Z ly20 Vision Program (IOI19_vision) C++17
14 / 100
13 ms 1532 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 210;
vector <int> resp;
vector <int> col[MAXN], ln[MAXN];
int d0c, d0l;
int idc[MAXN], idl[MAXN];
int d1l, d1c;
void construct_network(int h, int w, int k) {
	for(int i = 0; i < h; i++) {
		for(int j = 0; j < w; j++) {
			int id = i * w + j;
			col[j].push_back(id);
			ln[i].push_back(id);
		}
	}
	for(int i = 0; i < h; i++) idl[i] = add_or(ln[i]);
	for(int i = 0; i < w; i++) idc[i] = add_or(col[i]);
	vector <int> cl, l;
	for(int i = 0; i < h; i++) l.push_back(idl[i]);
	for(int i = 0; i < w; i++) cl.push_back(idc[i]);
	d0c = add_xor(cl); d0l = add_xor(l);
	cl.clear(); l.clear();
	for(int i = 0; i < h - 1; i++) {
		vector <int> t;
		t.push_back(idl[i]); t.push_back(idl[i + 1]);
		l.push_back(add_and(t));
	}
	if(l.size() == 0) {
		d1l = add_not(d0l);
 	}
	else d1l = add_or(l);
	for(int i = 0; i < w - 1; i++) {
		vector <int> t;
		t.push_back(idc[i]); t.push_back(idc[i + 1]);
		cl.push_back(add_and(t));
	}
	if(cl.size() == 0) {
		d1c = add_not(d0c);
	}
	else d1c = add_or(cl);
	vector <int> t, t1, t2;
	t1.push_back(d0c); t1.push_back(d1l);
	t2.push_back(d1c); t2.push_back(d0l);
	t.push_back(add_and(t1)); t.push_back(add_and(t2));
	add_or(t);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 332 KB Output is correct
2 Incorrect 2 ms 332 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 208 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 11 ms 1532 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 2 ms 460 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 6 ms 916 KB Output is correct
8 Correct 6 ms 956 KB Output is correct
9 Correct 13 ms 1520 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -