Submission #1071308

# Submission time Handle Problem Language Result Execution time Memory
1071308 2024-08-23T06:38:50 Z pcc Vision Program (IOI19_vision) C++17
0 / 100
3 ms 4820 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

#define pii pair<int,int>
#define fs first
#define sc second

int H,W,K;

int encode(int r,int c){
	return r*W+c;
}
pii decode(int k){
	return pii(k/W,k%W);
}


void construct_network(int HH, int WW, int KK) {
	H = HH,W = WW,K = KK;
	int zero = add_xor({0,0});
	vector<int> row,col;
	for(int i = 0;i<H;i++){
		vector<int> v;
		for(int j = 0;j<W;j++)v.push_back(encode(i,j));
		row.push_back(add_or(v));
	}
	for(int i = 0;i<W;i++){
		vector<int> v;
		for(int j = 0;j<H;j++){
			v.push_back(encode(j,i));
			col.push_back(add_or(v));
		}
	}
	int t1 = add_xor(row);
	{
		int tmp = zero;
		for(int i = 0;i+1<W;i++){
			tmp = add_or({tmp,add_and({col[i],col[i+1]})});
		}
		t1 = add_and({t1,tmp});
	}

	//same col

	int t2 = add_xor(col);
	{
		int tmp = zero;
		for(int i = 0;i+1<H;i++){
			tmp = add_or({tmp,add_and({row[i],row[i+1]})});
		}
		t2 = add_and({t2,tmp});
	}

	add_or({t1,t2});
	return;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 348 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 344 KB Output is correct
2 Incorrect 0 ms 348 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 344 KB Output is correct
2 Incorrect 0 ms 348 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 344 KB Output is correct
2 Incorrect 0 ms 348 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 344 KB Output is correct
2 Incorrect 1 ms 348 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 Incorrect 0 ms 348 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 4820 KB WA in grader: Too many inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -