Submission #169940

# Submission time Handle Problem Language Result Execution time Memory
169940 2019-12-23T10:47:38 Z nandonathaniel Vision Program (IOI19_vision) C++14
0 / 100
3 ms 632 KB
#include "vision.h"
#include "bits/stdc++.h"
using namespace std;

vector<int> sum(vector<int> v,int x){
	vector<int> simpan;
	for(int i=0;i<9;i++){
		simpan.push_back(add_xor({v[i],x}));
		x=add_and({v[i],x});
	}
	return simpan;
}

vector<int> jumlah(vector<int> v,vector<int> u){
	vector<int> ret;
	ret.push_back(add_and({0,add_not(0)}));
	for(int i=1;i<=8;i++)add_and({ret[0]});
	for(auto isi : v)ret=sum(ret,isi);
	for(auto isi : u)ret=sum(ret,isi);
	return ret;
}

vector<int> baris(int h,int w){
	vector<int> ret;
	for(int i=0;i<h;i++){
		vector<int> v;
		for(int j=0;j<w;j++)v.push_back(i*w+j);
		ret.push_back(add_xor(v));
	}
	return ret;
}

vector<int> kolom(int h,int w){
	vector<int> ret;
	for(int j=0;j<w;j++){
		vector<int> v;
		for(int i=0;i<h;i++)v.push_back(i*w+j);
		ret.push_back(add_xor(v));
	}
	return ret;
}

void sama(vector<int> v,int k){
	for(int i=0;i<9;i++){
		if(!((1<<i) & k))v[i]=add_not(v[i]);
	}
	add_and(v);
}

void construct_network(int H, int W, int K) {
	sama(jumlah(baris(H,W),kolom(H,W)),K);
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 632 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -