Submission #401640

# Submission time Handle Problem Language Result Execution time Memory
401640 2021-05-10T15:43:42 Z snasibov05 Vision Program (IOI19_vision) C++14
0 / 100
2 ms 1096 KB
#include "vision.h"

using namespace std;

#define pb push_back

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

    vector<int> v;
    int k = H*W;

    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            int cur = i * W + j;
            vector<int> arr;
            arr.pb(cur);
            for (int l = 0; l < K; ++l) {
                int to = (i + l) * W + j + (K - l);
                if (to >= 0 && to < H*W){
                    arr.pb(to);
                    add_and(arr);
                    arr.pop_back();
                    v.pb(k++);
                }
                to = (i + l) * W + j - (K - l);
                if (to >= 0 && to < H*W){
                    arr.pb(to);
                    add_and(arr);
                    arr.pop_back();
                    v.pb(k++);
                }
                to = (i - l) * W + j + (K - l);
                if (to >= 0 && to < H*W){
                    arr.pb(to);
                    add_and(arr);
                    arr.pop_back();
                    v.pb(k++);
                }
                to = (i - l) * W + j - (K - l);
                if (to >= 0 && to < H*W){
                    arr.pb(to);
                    add_and(arr);
                    arr.pop_back();
                    v.pb(k++);
                }
            }
        }
    }

    add_or(v);

}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 280 KB Output is correct
4 Incorrect 1 ms 284 KB on inputs (0, 0), (1, 0), expected 0, but computed 1
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 280 KB Output is correct
4 Incorrect 1 ms 284 KB on inputs (0, 0), (1, 0), expected 0, but computed 1
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 280 KB Output is correct
4 Incorrect 1 ms 284 KB on inputs (0, 0), (1, 0), expected 0, but computed 1
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 280 KB Output is correct
4 Incorrect 1 ms 284 KB on inputs (0, 0), (1, 0), expected 0, but computed 1
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 280 KB Output is correct
2 Incorrect 1 ms 332 KB on inputs (0, 0), (0, 101), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 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 2 ms 1096 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 280 KB Output is correct
4 Incorrect 1 ms 284 KB on inputs (0, 0), (1, 0), expected 0, but computed 1
5 Halted 0 ms 0 KB -