Submission #602773

#TimeUsernameProblemLanguageResultExecution timeMemory
602773AriaHVision Program (IOI19_vision)C++17
33 / 100
108 ms1060 KiB
#include "vision.h"
#pragma GCC optimize("O3")

#include <bits/stdc++.h>

using namespace std;

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

#define F first
#define S second
#define all(x) x.begin(), x.end()
#define SZ(x) (int)x.size()
#define Mp make_pair
#define endl "\n"
#define fast_io ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int N = 1e6 + 10;
const int LOG = 20;
const ll mod = 1e9 + 7;
const ll inf = 8e18;

int n, m, k;

inline int id(int i, int j)
{
	return i * m + j;
}

void construct_network(int _n, int _m, int _k)
{
	n = _n;
	m = _m;
	k = _k;
	int tot = 0;
	for(int i = 0; i < n; i ++)
	{
		for(int j = 0; j < m; j ++)
		{
			for(int i2 = 0; i2 < n; i2 ++)
			{
				for(int j2 = 0; j2 < m; j2 ++)
				{
					if(abs(i - i2) + abs(j - j2) == k)
					{
						tot ++;
						add_and({id(i, j), id(i2, j2)});
					}
				}
			}
		}
	}
	int base = n * m;
	vector < int > now;
	for(int i = 0; i < tot; i ++)
	{
		now.push_back(i + base);
	}
	add_or(now);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...