Submission #778507

# Submission time Handle Problem Language Result Execution time Memory
778507 2023-07-10T11:26:33 Z Josia Vision Program (IOI19_vision) C++17
0 / 100
1 ms 212 KB
#include "vision.h"

#include<bits/stdc++.h>

using namespace std;


int convert(pair<int, int> cords, int H, int W) {
	return cords.first*W + cords.second;
}


void construct_network(int H, int W, int K) {
	vector<pair<int, int>> prs;

	int i = 0, j=0;

	// for (int i=0; i<H; i++) {
	// 	for (int j = 0; j<W; j++) {
			for (int k = max(0, i-K); k<min(H, i+K); k++) {
				for (int l = max(0, j-K); l<min(W, j+K); l++) {
					if (abs(i-k) + abs(j-l) == K) {
						prs.push_back({min(convert({k,l}, H, W), convert({i,j}, H, W)), max(convert({k,l}, H, W), convert({i,j}, H, W))});
					}
				}
			}
	// 	}
	// }
	sort(prs.begin(), prs.end());
	prs.erase(unique(prs.begin(), prs.end()), prs.end());

	vector<int> blub = {0};
	for (int i= 0; i<prs.size(); i++) {
		blub.push_back(add_and(vector<int>{prs[i].first, prs[i].second}));
	}

	add_or(blub);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:33:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |  for (int i= 0; i<prs.size(); 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 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), (1, 1), 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 (80, 199), (81, 199), expected 1, but computed 0
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 -