Submission #815470

# Submission time Handle Problem Language Result Execution time Memory
815470 2023-08-08T15:30:37 Z PagodePaiva Vision Program (IOI19_vision) C++14
0 / 100
1 ms 1084 KB
    #include "vision.h"
    #include<bits/stdc++.h>
    #define fr first
    #define sc second
    #define pii pair <int, int>

    using namespace std;
     
    int dist(pair <int,int>a,pair<int,int>b){
    	return abs(a.fr-b.fr)+abs(a.sc-b.sc);
    }
    
    set <pair <pii, pii>> s;

    void construct_network(int H, int W, int K) {
    	// std::vector<int> Ns;
    	// Ns = {0, 1};
    	// int a = add_and(Ns);
    	// Ns = {0, a};
    	// int b = add_or(Ns);
    	// Ns = {0, 1, b};
    	// int c = add_xor(Ns);
    	// add_not(c);
     
    	int n = H, m = W, k = K;
    	int r = n*m;
     	vector <int> auxx;
     	vector <int> aux;

    	for(int i = 0;i < n;i++){
    		for(int j = 0;j < m;j++){
    			if(i+1 < n) auxx.push_back((i+1)*m+j);
    			if(j+1 < m)	auxx.push_back(i*m+j+1);

    			if(auxx.size() == 0) continue;

    			int a1 = add_xor(auxx);
    			auxx.push_back({i*m+j});
    			int a2 = add_xor(auxx);
    			a2 = add_not(a2);
    			r = add_and({a1, a2});
    			aux.push_back(r);
    			auxx.clear();
    		}
    	}

    	// for(auto x : aux) cout << x << " ";

    	add_or(aux);
     
    	return;
    }

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:25:24: warning: unused variable 'k' [-Wunused-variable]
   25 |      int n = H, m = W, k = K;
      |                        ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Incorrect 1 ms 340 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1084 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -