Submission #424763

# Submission time Handle Problem Language Result Execution time Memory
424763 2021-06-12T09:45:21 Z TryMax Vision Program (IOI19_vision) C++17
8 / 100
6 ms 460 KB
#include "vision.h"
#include <bits/stdc++.h>
#ifdef LOCAL
    #include "grader.cpp"
#endif // LOCAL

#define pb push_back

using namespace std;

const int N = 1e5 + 10;

int n, m, k;

int dist(int x, int y, int x1, int y1){
    return abs(x - x1) + abs(y - y1);
}

int pos(int x, int y){
    return x * m + y;
}

void construct_network(int N, int M, int K){
    n = N;
    m = M;
    k = K;
    int last = 0;
	for(int i = 0; i < n; ++i)
        for(int j = 0; j < m; ++j){
            vector<int> q;
            for(int i1 = i; i1 < n; ++i1)
                for(int j1 = 0; j1 < m; ++j1)
                    if(dist(i, j, i1, j1) == k)
                        q.pb(pos(i1, j1));
            if(!q.empty()){
                int t = add_or(q);
                q.clear();
                q.pb(pos(i, j));
                q.pb(t);
                last = add_and(q);
            }
            break;
        }
    vector<int> q;
    for(int i = n * m + 1; i <= last; i += 2)
        q.pb(i);
    add_or(q);
}
/*
2 3 3
0 0 0 1
0 0 0 2
0 0 1 0
0 0 1 1
0 0 1 2
0 1 0 2
0 1 1 0
0 1 1 1
0 1 1 2
0 2 1 0
0 2 1 1
0 2 1 2
1 0 1 1
1 0 1 2
1 1 1 2
-1
*/
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 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 332 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 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 0 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 2 ms 332 KB Output is correct
21 Correct 4 ms 460 KB Output is correct
22 Correct 3 ms 332 KB Output is correct
23 Correct 3 ms 204 KB Output is correct
24 Correct 2 ms 204 KB Output is correct
25 Correct 2 ms 332 KB Output is correct
26 Correct 1 ms 204 KB Output is correct
27 Correct 4 ms 204 KB Output is correct
28 Correct 6 ms 460 KB Output is correct
29 Correct 6 ms 460 KB Output is correct
30 Correct 6 ms 288 KB Output is correct
31 Correct 4 ms 292 KB Output is correct
32 Correct 1 ms 204 KB Output is correct
33 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 204 KB on inputs (80, 199), (81, 199), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -