Submission #238212

# Submission time Handle Problem Language Result Execution time Memory
238212 2020-06-10T08:57:40 Z Ruxandra985 Vision Program (IOI19_vision) C++14
12 / 100
13 ms 1148 KB
#include <bits/stdc++.h>
#include <cassert>
#include <string>
#include "vision.h"

using namespace std;


/// ---------------------------------------------------------------------------------

int res[1000010];

int convert (int x , int y , int n , int m){

    return (x - 1) * m + y - 1;

}

int in_matrix (int i , int j , int n , int m){

    return (i > 0 && j > 0 && i <= n && j <= m);

}


void construct_network(int n, int m, int k) {

    int i , j , pi , pj , op;
    vector <int> v;
    op = 0;

    for (i = 1 ; i <= n ; i++){

        for (j = 1 ; j <= m ; j++){

            v.clear();

            for (pi = 0 ; pi <= k ; pi++){


                pj = k - pi;

                //if (in_matrix(i + pi , j + pj , n , m))
                  //  v.push_back(convert(i + pi , j + pj , n , m));

                //if (in_matrix(i + pi , j - pj , n , m))
                  //  v.push_back(convert(i + pi , j - pj , n , m));

                //if (in_matrix(i - pi , j + pj , n , m))
                  //  v.push_back(convert(i - pi , j + pj , n , m));

                if (in_matrix(i - pi , j - pj , n , m))
                    v.push_back(convert(i - pi , j - pj , n , m));



            }
            if (v.empty())
                continue;
            add_xor(v);
            op++;

            v.clear();
            v.push_back(n * m + (op - 1));
            v.push_back(convert(i , j , n , m));

            add_and(v);
            op++;
            /// res[ceva impar] e rezultatul unui and

        }

    }
    v.clear();
    for (i = 1 ; i < op ; i += 2){
        v.push_back(n * m + i);
    }

    add_or(v);


}
# Verdict Execution time Memory Grader output
1 Correct 4 ms 256 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 256 KB Output is correct
5 Correct 4 ms 384 KB Output is correct
6 Incorrect 4 ms 256 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 256 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 256 KB Output is correct
5 Correct 4 ms 384 KB Output is correct
6 Incorrect 4 ms 256 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 256 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 256 KB Output is correct
5 Correct 4 ms 384 KB Output is correct
6 Incorrect 4 ms 256 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 256 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 256 KB Output is correct
5 Correct 4 ms 384 KB Output is correct
6 Incorrect 4 ms 256 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 4 ms 256 KB Output is correct
5 Correct 5 ms 384 KB Output is correct
6 Correct 5 ms 384 KB Output is correct
7 Correct 5 ms 384 KB Output is correct
8 Correct 4 ms 384 KB Output is correct
9 Correct 5 ms 384 KB Output is correct
10 Correct 5 ms 384 KB Output is correct
11 Correct 4 ms 384 KB Output is correct
12 Correct 4 ms 384 KB Output is correct
13 Correct 5 ms 256 KB Output is correct
14 Correct 4 ms 256 KB Output is correct
15 Correct 5 ms 384 KB Output is correct
16 Correct 5 ms 384 KB Output is correct
17 Correct 5 ms 384 KB Output is correct
18 Correct 6 ms 384 KB Output is correct
19 Correct 5 ms 256 KB Output is correct
20 Correct 4 ms 256 KB Output is correct
21 Correct 4 ms 256 KB Output is correct
22 Correct 5 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 256 KB Output is correct
2 Correct 4 ms 256 KB Output is correct
3 Correct 8 ms 892 KB Output is correct
4 Correct 13 ms 1020 KB Output is correct
5 Correct 9 ms 768 KB Output is correct
6 Correct 6 ms 512 KB Output is correct
7 Correct 5 ms 256 KB Output is correct
8 Incorrect 6 ms 1148 KB WA in grader: Too many instructions
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 1148 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 256 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 4 ms 256 KB Output is correct
5 Correct 4 ms 384 KB Output is correct
6 Incorrect 4 ms 256 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -