Submission #201279

# Submission time Handle Problem Language Result Execution time Memory
201279 2020-02-10T06:01:43 Z khulegub Vision Program (IOI19_vision) C++14
0 / 100
15 ms 1120 KB
#include "vision.h"
#include <bits/stdc++.h>

#define pb push_back
#define mp make_pair
#define rr first
#define cc second

using namespace std;

typedef pair<int, int> pii;

int hh, ww, kk;

pii to_pair(int x){
	return mp(x / ww, x % ww);
}
int to_linear(pii x){
	return x.rr * ww + x.cc; 
}

void construct_network(int H, int W, int K) {

	// proj y
	hh = H, ww = W, kk = K;

	int one = add_or( {0, 1} ), zero = add_not(one);

	vector<int> proj_y;

	for (int i = 0; i < ww; i++){
		vector<int> send;
		for (int j = 0; j < hh; j++){
			send.pb(to_linear(mp(i, j)));
		}
		proj_y.pb(add_xor(send));
	}

	vector<int> proj_x;

	for (int i = 0; i < hh; i++){
		vector<int> send;
		for (int j = 0; j < ww; j++){
			send.pb(to_linear(mp(j, i)));
		}
		proj_x.pb(add_xor(send));
	}


	// // max val = h + w
	// // log_2 (400) + 1 = 9

	// vector<int> counter;

	// for (int i = 0; i < 10; i++){
	// 	counter.pb(add_and({zero, 0}));
	// }


	// for (int i = 0; i < ww; i++){
		

	// 	int adder = proj_y[i];

	// 	for (int i = 0; i < 10; i++){
	// 		int tmp = counter[i];
	// 		counter[i] = add_xor({counter[i], adder});
	// 		adder = add_and({tmp, adder});
	// 	}

	// }
	// for (int i = 0; i < hh; i++){
		

	// 	int adder = proj_x[i];

	// 	for (int i = 0; i < 10; i++){
	// 		int tmp = counter[i];
	// 		counter[i] = add_xor({counter[i], adder});
	// 		adder = add_and({tmp, adder});
	// 	}
	// }
	// kk = kk + 2;
	// int last = one;
	// for (int i = 9; i >= 0; i++){
	// 	int cmp = add_xor({counter[i], (kk % 2) ? (zero) : (one) });
	// 	kk >>= 1;
	// 	// cmp = add_not(cmp); this is saved by switching the k % 2 outcome
	// 	last = add_and({last, cmp});
	// }
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:27:30: warning: unused variable 'zero' [-Wunused-variable]
  int one = add_or( {0, 1} ), zero = add_not(one);
                              ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 376 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 376 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 15 ms 1120 KB on inputs (80, 199), (81, 199), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 256 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -