Submission #401677

# Submission time Handle Problem Language Result Execution time Memory
401677 2021-05-10T16:41:52 Z snasibov05 Vision Program (IOI19_vision) C++14
12 / 100
16 ms 1228 KB
#include "vision.h"
#include <set>

using namespace std;

#define pb push_back

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

    vector<int> v;
    int k = H*W;
    
    vector<bool> used(H*W);

    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            int cur = i * W + j;
            if (used[cur]) continue;
            used[cur] = true;
            vector<int> arr;
            for (int l = 0; l <= K; ++l) {
                int to = (i + l) * W + j + (K - l);
                if (to >= 0 && to < H*W && j + (K - l) < W && i + l < H){
                    arr.pb(to);
                    used[to] = true;
                }
                to = (i + l) * W + j - (K - l);
                if (to >= 0 && to < H*W && j - (K - l) >= 0 && i + l < H){
                    arr.pb(to);
                    used[to] = true;
                }
                to = (i - l) * W + j + (K - l);
                if (to >= 0 && to < H*W && j + (K - l) < W && i - l >= 0){
                    arr.pb(to);
                    used[to] = true;
                }
                to = (i - l) * W + j - (K - l);
                if (to >= 0 && to < H*W && j - (K - l) >= W && i - l >= H){
                    arr.pb(to);
                    used[to] = true;
                }
            }

            if (arr.empty()) continue;
            add_or(arr);
            arr = {k , cur};
            k++;
            add_and(arr), v.pb(k++);
        }
    }

    add_or(v);

}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Incorrect 1 ms 204 KB on inputs (0, 2), (1, 1), expected 1, but computed 0
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Incorrect 1 ms 204 KB on inputs (0, 2), (1, 1), expected 1, but computed 0
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Incorrect 1 ms 204 KB on inputs (0, 2), (1, 1), expected 1, but computed 0
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Incorrect 1 ms 204 KB on inputs (0, 2), (1, 1), expected 1, but computed 0
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 256 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Correct 1 ms 204 KB Output is correct
21 Correct 1 ms 204 KB Output is correct
22 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 3 ms 460 KB Output is correct
4 Correct 3 ms 460 KB Output is correct
5 Correct 8 ms 716 KB Output is correct
6 Correct 4 ms 460 KB Output is correct
7 Correct 2 ms 276 KB Output is correct
8 Correct 7 ms 764 KB Output is correct
9 Correct 12 ms 1212 KB Output is correct
10 Correct 16 ms 1228 KB Output is correct
11 Correct 7 ms 560 KB Output is correct
12 Correct 4 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 1 ms 204 KB Output is correct
17 Correct 1 ms 204 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Incorrect 3 ms 968 KB WA in grader: Too many instructions
21 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 968 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Incorrect 1 ms 204 KB on inputs (0, 2), (1, 1), expected 1, but computed 0
9 Halted 0 ms 0 KB -