답안 #425155

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
425155 2021-06-12T14:05:27 Z schse Vision Program (IOI19_vision) C++17
26 / 100
10 ms 1100 KB
#include "vision.h"
#ifndef EVAL
#include "grader.cpp"
#endif
#include <bits/stdc++.h>
using namespace std;

void construct_network(int H, int W, int K)
{

	if (H == 1 || W == 1)
	{
		vector<int> lr;
		for (int i = 0; i < H * W - K; i++)
			lr.push_back(add_and({i, i + K}));
		int N = add_or(lr);
		return;
	}

	vector<int> xorrows;
	for (int r = 0; r < H; r++)
	{
		vector<int> v(W);
		iota(v.begin(), v.end(), r * W);
		xorrows.push_back(add_xor(v));
	}
	int diffrentcols = add_or(xorrows);
	int iscrows;
	{
		vector<int> c;
		for (int r = 1; r < H; r++)
		{
			c.push_back(add_and({xorrows[r], xorrows[r - 1]}));
		}
		iscrows = add_or(c);
	}

	vector<int> xorcols;
	for (int c = 0; c < W; c++)
	{
		vector<int> v;
		for (int r = 0; r < H; r++)
			v.push_back(c + r * W);
		xorcols.push_back(add_xor(v));
	}

	int diffrentrows = add_or(xorcols);
	int isccols;
	{
		vector<int> c;
		for (int r = 1; r < W; r++)
		{
			c.push_back(add_and({xorcols[r], xorcols[r - 1]}));
		}
		isccols = add_or(c);
	}
	add_and({add_xor({diffrentcols, diffrentrows}), add_xor({isccols, iscrows})});
	return;
}

Compilation message

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