답안 #578712

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
578712 2022-06-17T18:00:21 Z Vanilla Vision Program (IOI19_vision) C++17
12 / 100
8 ms 1048 KB
#include <bits/stdc++.h>
#include "vision.h"
using namespace std;

int dist (int x1, int y1, int x2, int y2) {
	return abs(x2 - x1) + abs(y2 - y1);
}

void construct_network(int H, int W, int K) {
	int op = 0;
	vector <int> row, col;
	for (int i = 0; i < H; i++){
		vector <int> v;
		for (int j = 0; j < W; j++){
			v.push_back(i * W + j);
		}
		row.push_back(add_or(v));
	}
	for (int j = 0; j < W; j++){
		vector <int> v;
		for (int i = 0; i < H; i++){
			v.push_back(i * W + j);
		}
		col.push_back(add_or(v));
	}
	vector <int> rs;
	vector <int> c23;
	for (int i = 0; i + K < H; i++){
		c23.push_back(add_and({row[i], row[i + K]}));
	}
	for (int i = 0; i + K < W; i++){
		c23.push_back(add_and({col[i], col[i + K]}));
	}
	if (c23.size() >= 1) add_xor(c23);
	else add_and({0, add_not(0)}); // always 0
	
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:10:6: warning: unused variable 'op' [-Wunused-variable]
   10 |  int op = 0;
      |      ^~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Incorrect 1 ms 212 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Incorrect 1 ms 212 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Incorrect 1 ms 212 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Incorrect 1 ms 212 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 212 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB on inputs (0, 0), (1, 1), expected 1, but computed 0
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 8 ms 1048 KB on inputs (57, 107), (59, 108), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Incorrect 1 ms 212 KB on inputs (0, 1), (1, 0), expected 1, but computed 0
7 Halted 0 ms 0 KB -