Submission #1026743

# Submission time Handle Problem Language Result Execution time Memory
1026743 2024-07-18T10:21:16 Z ach00 Vision Program (IOI19_vision) C++14
0 / 100
9 ms 1960 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

int h,w,k;

bool bounds(int y, int x) {
	if(y >= 0 && x >= 0 && y < h && x < w) return true;
	return false;
}

void construct_network(int H, int W, int K) {
    h = H; w = W; k = K;
    int index = H*W;
    vector<int> and_indices;

    for(int y = 0; y < H; y++) {
        for(int x = 0; x < W; x++) {
            vector<int> P;
            for(int i = 0; i <= K; i++) {
                int fdir = i;
                int sdir = K-i;
                if(bounds(y+fdir, x+sdir)) P.push_back((y+fdir)*W + x+sdir);
                if(bounds(y+fdir, x-sdir)) P.push_back((y+fdir)*W + x-sdir);
                if(bounds(y-fdir, x+sdir)) P.push_back((y-fdir)*W + x+sdir);
                if(bounds(y-fdir, x-sdir)) P.push_back((y-fdir)*W + x-sdir);
            }
            add_or(P);
            index++;
            and_indices.push_back(index);
            add_and({y*W + x, index-1});
            index++;
        }
    }

    add_or(and_indices);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Incorrect 1 ms 348 KB WA in grader: Instruction with no inputs
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 3 ms 988 KB Output is correct
4 Correct 9 ms 1960 KB Output is correct
5 Correct 7 ms 1496 KB Output is correct
6 Incorrect 1 ms 344 KB WA in grader: Instruction with no inputs
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1240 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -