Submission #152141

# Submission time Handle Problem Language Result Execution time Memory
152141 2019-09-06T15:31:11 Z stefdasca Vision Program (IOI19_vision) C++14
0 / 100
4 ms 1140 KB
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K)
{
    /*
	vector<int> Ns;
	Ns = {0, 1};
	int a = add_and(Ns);
	Ns = {0, a};
	int b = add_or(Ns);
	Ns = {0, 1, b};
	int c = add_xor(Ns);
	add_not(c);
	*/
	int fi = H * W;
	int lst = H * W - 1;
	for(int i = 0; i < H; ++i)
        for(int j = 0; j < W; ++j)
            add_and({i * W + j}), ++lst;
    int fi2 = lst + 1;
    int lst2 = lst;
    lst = H * W;
	for(int i = 0; i < H; ++i)
        for(int j = 0; j < W; ++j)
        {
            vector<int>vec;
            for(int q = 0; q < H; ++q)
                for(int z = 0; z < W; ++z)
                    if(abs(i - q) + abs(j - z) == K)
                        vec.push_back(q * W + z);
            add_and({lst, add_and(vec)});
            ++lst2;
            ++lst;
        }
    vector<int>s;
    for(int i = fi2; i <= lst2; ++i)
        s.push_back(i);
    add_or(s);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:16:6: warning: unused variable 'fi' [-Wunused-variable]
  int fi = H * W;
      ^~
# Verdict Execution time Memory Grader output
1 Incorrect 2 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 2 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 2 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 2 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 2 ms 424 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 2 ms 376 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 4 ms 1140 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -