| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 424692 | TryMax | Vision Program (IOI19_vision) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <bits/stdc++.h>
#ifdef LOCAL
#include "grader.cpp"
#endif // LOCAL
#define pb push_back
const int N = 1e5 + 10;
int n, m, k;
int dist(int x, int y, int x1, int y1){
return abs(x - x1) + abs(y - y1);
}
int pos(int x, int y){
return x * m + y;
}
void construct_network(int N, int M, int K){
n = N;
m = M;
k = K;
int last = 0;
for(int i = 0; i < n; ++i)
for(int j = 0; j < m; ++j)
for(int i1 = i; i1 < n; ++i1)
for(int j1 = 0; j1 < m; ++j1)
if(dist(i, j, i1, j1) == k){
vector<int> q;
q.pb(pos(i, j));
q.pb(pos(i1, j1));
last = add_and(q);
}
vector<int> q;
for(int i = N * M; i <= last; ++i)
q.pb(i);
add_or(q);
}
/*
2 3 3
0 0 0 1
0 0 0 2
0 0 1 0
0 0 1 1
0 0 1 2
0 1 0 2
0 1 1 0
0 1 1 1
0 1 1 2
0 2 1 0
0 2 1 1
0 2 1 2
1 0 1 1
1 0 1 2
1 1 1 2
-1
*/
