이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#define endl '\n'
#define db double
#define ll __int128
#define pb push_back
#define fs first
#define sd second
#define Mod long(1e9 + 7)
#define all(x) x.begin(), x.end()
#define unvisited long(-1)
#define Eps double(1e-9)
#define _for(i, n) for(int i = 0; i < (n); i++)
#define dbg(x) cout << #x ": " << x << endl;
const int Max = 1e6 + 7, Inf = 1e9 + 7;
int pos(int i, int j, int w){
return i * w + j;
}
void construct_network(int h, int w, int k)
{
int ini = h*w, last = h*w-1; //cerr << h << " " << w << " " << k << endl;
for(int i = 0; i < h; i++)
{
for(int j = 0; j < w; j++)
{
for(int l = 0; l <= i; l++)
{
for(int m = 0; m < w; m++)
{
if(abs(l - i) + abs(m - j) == k){
add_and({ pos(l, m, w), pos(i, j, w) });
//cerr << pos(l, m, w) << " " << pos(i, j, w) << endl;
last++;
}
}
}
}
}
if(ini > last) return;
vector <int> s;
for(int i = ini; i <= last; i++){
s.push_back(i);
}
add_or(s);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |