Submission #603083

# Submission time Handle Problem Language Result Execution time Memory
603083 2022-07-23T15:03:42 Z lcj Vision Program (IOI19_vision) C++17
0 / 100
9 ms 1108 KB
#include <bits/stdc++.h>
#include "vision.h"
#define loc(i, j) i*W+j
#define adv1(x) x.push_back(base + cnt);cnt++;

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

void construct_network(int H, int W, int K) {
	int cnt = 0;
	int base = H*W-1;
	vector<int> indires;
    vector<int> pos, neg;
    for (int i = -W+1; i < H; i++)
    {
        int cur = i;
        vector<int> locs;
        for (int j = 0; j < W; j++)
        {
            if (cur >= 0 && cur < H) {
                locs.push_back(loc(cur, j));
            }
            cur++;
        }
        add_or(locs);
        adv1(pos)
    }
    for (int i = 0; i < H+W-1; i++)
    {
        int cur = i;
        vector<int> locs;
        for (int j = 0; j < W; j++)
        {
            if (cur >= 0 && cur < H) {
                locs.push_back(loc(cur, j));
            }
            cur--;
        }
        add_or(locs);
        adv1(neg)
    }
    for (int i = 0; i < pos.size()-K; i++)
    {
        add_and({pos[i], pos[i+K]});
        adv1(indires)
    }
    for (int i = 0; i < neg.size()-K; i++)
    {
        add_and({neg[i], neg[i+K]});
        adv1(indires);
    }
    add_or(indires);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:45:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |     for (int i = 0; i < pos.size()-K; i++)
      |                     ~~^~~~~~~~~~~~~~
vision.cpp:50:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   50 |     for (int i = 0; i < neg.size()-K; i++)
      |                     ~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 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 9 ms 1108 KB on inputs (126, 120), (176, 169), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 2), expected 0, but computed 1
2 Halted 0 ms 0 KB -