#include <bits/stdc++.h>
#include "vision.h"
#pragma GCC optimize("O2,unroll-loops")
#define fio ios_base::sync_with_stdio(0);cin.tie(0);
#define ll long long
#define en cin.close();return 0;
#define pb push_back
#define fi first//printf("%lli\n",cur);
#define se second//scanf("%lli",&n);
#define r0 return 0;
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void construct_network(int h, int w, int k)
{
vector<int> r[h], c[w];
for(int i = 0;i<h;i++)
for(int j = 0;j<w;j++)
r[i].pb(i*w+j),
c[j].pb(i*w+j);
int p1 = -1, p2 = -1;
vector<int> temp;
for(int i = 0;i<h;i++)
temp.pb(add_xor(r[i]));
p1=add_or(temp);
temp.clear();
for(int i = 0;i<w;i++)
temp.pb(add_xor(c[i]));
p2=add_or(temp);
temp.clear();
int cond1=add_xor({p1,p2});
for(int i = 0;i<=h;i++)
{
vector<int> cur;
if(i<h)
cur.insert(cur.end(),r[i].begin(),r[i].end());
if(i>0)
cur.insert(cur.end(),r[i-1].begin(),r[i-1].end());
temp.pb(add_or(cur));
}
for(int i = 0;i<=w;i++)
{
vector<int> cur;
if(i<w)
cur.insert(cur.end(),c[i].begin(),c[i].end());
if(i>0)
cur.insert(cur.end(),c[i-1].begin(),c[i-1].end());
temp.pb(add_or(cur));
}
int cond2 = add_xor(temp);
add_and({cond1,cond2});
return;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
340 KB |
Output is correct |
2 |
Incorrect |
1 ms |
304 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
3024 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
3 ms |
468 KB |
Output is correct |
4 |
Correct |
4 ms |
724 KB |
Output is correct |
5 |
Correct |
1 ms |
340 KB |
Output is correct |
6 |
Correct |
1 ms |
304 KB |
Output is correct |
7 |
Correct |
18 ms |
1584 KB |
Output is correct |
8 |
Correct |
12 ms |
1620 KB |
Output is correct |
9 |
Correct |
27 ms |
3108 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
304 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |