Submission #316426

# Submission time Handle Problem Language Result Execution time Memory
316426 2020-10-26T10:35:39 Z talant117408 Vision Program (IOI19_vision) C++17
12 / 100
1 ms 384 KB
#include "vision.h"
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef pair <int, int> pii;
 
#define precision(n) fixed << setprecision(n)
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define mp make_pair
#define eps (double)1e-9
#define PI 2*acos(0.0)
#define endl "\n"
#define sz(v) int((v).size())
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define do_not_disturb ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define OK cout << "OK" << endl;

bool isEligible(int x, int y, int n, int m){
    return x > -1 && x < n && y > -1 && y < m;
}

void construct_network(int n, int m, int dist) {
	if(min(n, m) == 1){
        if(m == 1) swap(n, m);
        int ind = m;
        
        for(int i = 0; i+dist < m; i++){
            vector <int> v;
            v.pb(i); v.pb(i+dist);
            add_and(v);
            ind++;
        }
        vector <int> v;
        for(int i = m; i < ind; i++){
            v.pb(i);
        }
        add_or(v);
        return;
    }
    else if(n < 31 && m < 31){
        int ind = m;
        for(int i = 0; i < n; i++){
            for(int j = 0; j < m; j++){
                for(int x = i; x < n; x++){
                    for(int y = 0; y < m; y++){
                        if(abs(i-x)+abs(j-y) == dist){
                            vector <int> v;
                            v.pb(i*m+j); v.pb(x*m+y);
                            add_and(v);
                            ind++;
                        }
                    }
                }
            }
        }
        vector <int> v;
        for(int i = m; i < ind; i++){
            v.pb(i);
        }
        add_or(v);
        return;
    }
    vector <int> v;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            if(j+i == dist){
                v.pb(i*m+j);
            }
        }
    }
    add_or(v);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Incorrect 1 ms 256 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Incorrect 1 ms 256 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Incorrect 1 ms 256 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Incorrect 1 ms 256 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Correct 1 ms 384 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 1 ms 256 KB Output is correct
12 Correct 1 ms 256 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 0 ms 256 KB Output is correct
15 Correct 1 ms 256 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 1 ms 256 KB Output is correct
18 Correct 0 ms 256 KB Output is correct
19 Correct 1 ms 256 KB Output is correct
20 Correct 0 ms 256 KB Output is correct
21 Correct 0 ms 256 KB Output is correct
22 Correct 0 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 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 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Incorrect 1 ms 256 KB on inputs (0, 1), (1, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -