# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1027781 | 0npata | Sky Walking (IOI19_walk) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
#define vec vector
void construct_network(int H, int W, int K) {
//cerr << H << ' ' << W << ' ' << K << '\n';
auto dist = [&](int i, int j) {
int x1 = i%W;
int y1 = i/W;
int x2 = j%W;
int y2 = j/W;
return abs(x1-x2)+abs(y1-y2);
};
int cnt = 0;
for(int i = 0; i<H*W; i++) {
for(int j = i+1; j<H*W; j++) {
if(dist(i, j) == K) {
add_and({i, j});
// cerr << "HERE" << '\n';
cnt++;
}
}
}
// cerr << "OK" << '\n';
vec<int> or_check(cnt);
// cerr << cnt << '\n';
iota(or_check.begin(), or_check.end(), H*W);
add_or(or_check);
}