Submission #824813

# Submission time Handle Problem Language Result Execution time Memory
824813 2023-08-14T10:43:42 Z Magikarp4000 Vision Program (IOI19_vision) C++17
0 / 100
6 ms 980 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#define OPTM ios_base::sync_with_stdio(0); cin.tie(0);
#define INF int(1e9+7)
#define ln '\n' 
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned short
#define FOR(i,s,n) for (int i = s; i < n; i++)
#define FORR(i,n,s) for (int i = n; i > s; i--)
#define FORX(u, arr) for (auto u : arr)
#define PB push_back
#define F first
#define S second
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define UM unordered_map
#define US unordered_set
#define PQ priority_queue
#define ALL(v) v.begin(), v.end()
const ll LLINF = 1e18+1;

int H,W,K;
int cur,rst,cst,ren,cen,sen;

void init() {
    FOR(i,0,H) {
        vector<int> v;
        FOR(j,0,W) v.PB(i*W+j);
        add_or(v);
        cur++;
    }
    FOR(j,0,W) {
        vector<int> v;
        FOR(i,0,H) v.PB(i*W+j);
        add_or(v);
        cur++;
    }
}

void rowzero() {
    vector<int> v;
    FOR(i,0,H) v.PB(H*W+i);
    add_xor(v);
    cur++;
}

void colzero() {
    vector<int> v;
    FOR(i,0,W) v.PB(H*W+H+i);
    add_xor(v);
    cur++;
    cen = cur;
}

void sum() {
    vector<int> v1 = {H*W+H+W, H*W+H+K};
    add_and(v1);
    cur++;
    FOR(i,1,K) {
        if (i > H-1 || K-i > W-1) continue;
        vector<int> v = {H*W+i, H*W+H+K-i};
        add_and(v);
        cur++;
    }
    vector<int> v2 = {H*W+K, H*W+H+W+1};
    add_and(v2);
    cur++;
    sen = cur;
}

void finale() {
    vector<int> v;
    FOR(i,cen,sen) v.PB(i);
    add_or(v);
    cur++;
}

void construct_network(int h, int w, int k) {
    H = h, W = w, K = k;
    cur = H*W;
    // init
    init();
    // row
    rowzero();
    // col
    colzero();
    // final
    sum();
    finale();
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 1), (0, 2), 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, 1), (0, 2), 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, 1), (0, 2), 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, 1), (0, 2), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB on inputs (0, 1), (0, 3), expected 0, but computed 1
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 -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 980 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 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 1), (0, 2), expected 0, but computed 1
3 Halted 0 ms 0 KB -