#include <bits/stdc++.h>
#include "vision.h"
using namespace std;
#define endl '\n'
#define st first
#define nd second
#define pb push_back
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define ll long long
ll mod=1000000007;
int inf=1000000007;
ll infl=1000000000000000007;
int it;
/*
int add_not(int x)
{
it++;
cout<<it<<endl;
cout<<"NOT "<<x<<endl;
return it;
}
int add_or(vector<int>x)
{
it++;
cout<<it<<endl;
cout<<"OR ";
for(auto a:x) cout<<a<<" ";
cout<<endl;
return it;
}
int add_xor(vector<int>x)
{
it++;
cout<<it<<endl;
cout<<"XOR ";
for(auto a:x) cout<<a<<" ";
cout<<endl;
return it;
}
int add_and(vector<int>x)
{
it++;
cout<<it<<endl;
cout<<"AND ";
for(auto a:x) cout<<a<<" ";
cout<<endl;
return it;
}
*/
vector<int>add(vector<int>V,int k)
{
vector<int>res;
res.pb(add_xor({V[0],k}));
int w=add_and({V[0],k});
for(int i=1;i<=8;i++)
{
res.pb(add_xor({V[i],w}));
w=add_and({V[i],w});
}
return res;
}
void construct_network(int n,int m,int k)
{
it=n*m-1;
add_not(0);
for(int i=0;i<n;i++)
{
vector<int>V;
for(int j=0;j<m;j++) V.pb(i*m+j);
add_or(V);
}
add_and({0,n*m});
for(int i=0;i<n;i++) add_xor({n*m+n+i+1,n*m+1+i});
for(int j=0;j<m;j++)
{
vector<int>V;
for(int i=0;i<n;i++) V.pb(i*m+j);
add_or(V);
}
add_and({0,n*m});
for(int j=0;j<m;j++) add_xor({n*m+2*n+m+2+j,n*m+2*n+2+j});
vector<int>ans;
for(int i=0;i<=8;i++) ans.pb(add_and({0,n*m}));
for(int i=1;i<=n;i++) ans=add(ans,n*m+n+i+1);
for(int j=1;j<=m;j++) ans=add(ans,n*m+2*n+m+j+2);
int Z=add_and({0,n*m}),O=add_not(Z);
vector<int>wyn;
for(int i=0;i<=8;i++)
{
if(k&(1<<i)) wyn.pb(add_xor({Z,ans[i]}));
else wyn.pb(add_xor({O,ans[i]}));
}
add_and(wyn);
}
/*
int main()
{
construct_network(2,3,2);
return 0;
}
*/
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
556 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
1616 KB |
on inputs (80, 199), (81, 199), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |