#include <bits/stdc++.h>
#include "vision.h"
using namespace std;
#define fi first
#define se second
#define ll long long
#define pb push_back
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void construct_network(int H, int W, int K) {
vector<int> res;
int cnt=W*H;
int n=H;
int m=W;
for (int k = 0; k < 3; ++k)
{
vector<int> cur[2];
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < m; ++j)
{
if(i%3==k&&i<n-1){
cur[j%2].pb(i*m+j);
cur[j%2].pb((i+1)*m+j);
}
}
}
if(cur[0].size()){
add_and(cur[0]);
cur[0].clear();
res.pb(cnt);
cnt++;
}
if(cur[1].size()){
add_and(cur[1]);
cur[1].clear();
res.pb(cnt);
cnt++;
}
for (int i = 0; i < n; ++i)
{
for (int j = 0; j < m; ++j)
{
if(j%3==k&&j<m-1){
cur[i%2].pb(i*m+j);
cur[i%2].pb(i*m+j+1);
}
}
}
if(cur[0].size()){
add_and(cur[0]);
cur[0].clear();
res.pb(cnt);
cnt++;
}
if(cur[1].size()){
add_and(cur[1]);
cur[1].clear();
res.pb(cnt);
cnt++;
}
}
add_or(res);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
1924 KB |
on inputs (80, 199), (81, 199), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |