Submission #1050472

# Submission time Handle Problem Language Result Execution time Memory
1050472 2024-08-09T09:58:42 Z Kel_Mahmut Vision Program (IOI19_vision) C++14
0 / 100
36 ms 7540 KB
#include "vision.h"
#include <bits/stdc++.h>
#define pb push_back
#define endl ("\n")
#define all(aa) aa.begin(), aa.end()
typedef long long ll;
using namespace std;


void construct_network(int h, int w, int k) {
	function<int(int, int)> f = [&](int a, int b){
		return a * w + b;
	};

	vector<int> xdigit(9);

	for(int dig = 0; dig < 9; dig++){
		int num = 1 << dig;
		vector<vector<int>> query(num);
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++)
				query[j % num].pb(f(i, j));
		}

		vector<int> res;
		for(int i = 0; i < num; i++){
			if(query[i].size())
				res.pb(add_xor(query[i]));
		}
		xdigit[dig] = add_or(res);
	}

	vector<int> ydigit(9);
	for(int dig = 0; dig < 9; dig++){
		int num = 1 << dig;
		vector<vector<int>> query(num);
		for(int i = 0; i < h; i++){
			for(int j = 0; j < w; j++){
				query[i % num].pb(f(i, j));
			}
		}

		vector<int> res;
		for(int i = 0; i < num; i++){
			if(query[i].size())
				res.pb(add_xor(query[i]));
		}
		ydigit[dig] = add_or(res);
	}

	vector<int> notxdigit(9);
	vector<int> notydigit(9);
	for(int i = 0; i < 9; i++){
		notxdigit[i] = add_not(xdigit[i]);
	}

	for(int i = 0; i < 9; i++){
		notydigit[i] = add_not(ydigit[i]);
	}

	function<int(int)> xask = [&](int a){
		vector<int> query(9);
		for(int dig = 0; dig < 9; dig++){
			if((a >> dig) & 1){
				query[dig] = xdigit[dig];
			}
			else
				query[dig] = notxdigit[dig];
		}
		int ret = add_and(query);
		return ret;
	};

	function<int(int)> yask = [&](int a){
		vector<int> query(9);
		for(int dig = 0; dig < 9; dig++){
			if((a >> dig) & 1){
				query[dig] = ydigit[dig];
			}
			else
				query[dig] = notydigit[dig];
		}
		int ret = add_and(query);
		return ret;
	};


	vector<int> ans;
	for(int x = 0; x <= k; x++){
		int y = k - x;
		vector<int> cur;
		cur.pb(xask(x));
		cur.pb(yask(y));
		ans.pb(add_and(cur));
	}
	int lesgoo = add_or(ans);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:96:6: warning: unused variable 'lesgoo' [-Wunused-variable]
   96 |  int lesgoo = add_or(ans);
      |      ^~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 36 ms 7540 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 0 ms 600 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -