답안 #144392

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
144392 2019-08-16T19:27:20 Z qkxwsm Vision Program (IOI19_vision) C++14
0 / 100
11 ms 1220 KB
#include "vision.h"
#include <bits/stdc++.h>

using namespace std;

template<class T, class U>
void ckmin(T &a, U b)
{
	if (a > b) a = b;
}

template<class T, class U>
void ckmax(T &a, U b)
{
	if (a < b) a = b;
}

#define MP make_pair
#define PB push_back
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define FOR(i, a, b) for (auto i = (a); i < (b); i++)
#define FORD(i, a, b) for (auto i = (a) - 1; i >= (b); i--)
#define SZ(x) ((int) (x).size())
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpi;
typedef vector<pll> vpl;

int N, M, K, C, S[10];
vi tmp;

void construct_network(int n, int m, int k)
{
	//you want to see if the two squares with 1 are at distance K
	N = n; M = m; K = k;
	C = N * M;
	S[0] = C;
	FOR(i, 0, N + M - 1)
	{
		tmp.clear();
		FOR(x, 0, N)
		{
			int y = i - x;
			if (y < 0 || y >= M) continue;
			tmp.PB(x * M + y);
		}
		add_or(tmp);
		C++;
	}
	S[1] = C;
	FOR(i, -(M - 1), N)
	{
		tmp.clear();
		FOR(x, 0, N)
		{
			int y = x - i;
			if (y < 0 || y >= M) continue;
			tmp.PB(x * M + y);
		}
		add_or(tmp);
		C++;
	}
	S[2] = C;
	FOR(i, K, N + M - 1)
	{
		tmp.clear();
		tmp.PB(i + S[0]);
		tmp.PB((i - K) + S[0]);
		add_and(tmp);
		C++;
	}
	S[3] = C;
	FOR(i, -(M - 1) + K, N)
	{
		tmp.clear();
		tmp.PB(i + (M - 1) + S[1]);
		tmp.PB(i + (M - 1 - K) + S[0]);
		add_and(tmp);
		C++;
	}
	S[4] = C;
	tmp.clear();
	FOR(i, S[2], S[4])
	{
		tmp.PB(i);
	}
	add_or(tmp);
	return;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 376 KB on inputs (0, 97), (0, 100), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 256 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 11 ms 1220 KB on inputs (96, 130), (143, 84), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -