#include<bits/stdc++.h>
#include "vision.h"
#define fi first
#define se second
#define ll long long
using namespace std ;
//int sz ;
//int add_xor(vector<int> v)
//{
// cout << "? " ;
// for(int i : v)
// cout << i << ' ' ;
// cout << '\n' ;
//}
//int add_and()
//{
// cout << "? " ;
// for(int i : v)
// cout << i << ' ' ;
// cout << '\n' ;
//}
void construct_network(int n, int m, int k)
{
vector<int> arr_l, arr_l_k1, arr_l_k, arr_r, arr_r_k1, arr_r_k ;
for(int i = n - 1 ; i >= 0 ; i--)
{
int x = i, y = 0 ;
vector<int> now ;
while(x < n && y < m)
{
now.push_back(x * m + y) ;
x++ ;
y++ ;
}
arr_l.push_back(add_or(now)) ;
}
for(int i = 1 ; i < m ; i++)
{
int x = 0, y = i ;
vector<int> now ;
while(x < n && y < m)
{
now.push_back(x * m + y) ;
x++ ;
y++ ;
}
arr_l.push_back(add_or(now)) ;
}
for(int i = k ; i < arr_l.size() ; i++)
{
vector<int> now ;
for(int j = i - k ; j <= i ; j++)
now.push_back(arr_l[j]) ;
arr_l_k.push_back(add_xor({add_xor(now), add_or(now)})) ;
}
for(int i = k + 1 ; i < arr_l.size() ; i++)
{
vector<int> now ;
for(int j = i - k - 1 ; j <= i ; j++)
now.push_back(arr_l[j]) ;
arr_l_k1.push_back(add_xor({add_xor(now), add_or(now)})) ;
}
for(int i = 0 ; i < m ; i++)
{
int x = 0, y = i ;
vector<int> now ;
while(x >= 0 && y >= 0)
{
now.push_back(x * m + y) ;
x-- ;
y-- ;
}
arr_r.push_back(add_or(now)) ;
}
for(int i = 1 ; i < n ; i++)
{
int x = i, y = m - 1 ;
vector<int> now ;
while(x >= 0 && y >= 0)
{
now.push_back(x * m + y) ;
x-- ;
y-- ;
}
arr_r.push_back(add_or(now)) ;
}
for(int i = k ; i < arr_r.size() ; i++)
{
vector<int> now ;
for(int j = i - k ; j <= i ; j++)
now.push_back(arr_r[j]) ;
arr_r_k.push_back(add_xor({add_xor(now), add_or(now)})) ;
}
for(int i = k + 1 ; i < arr_r.size() ; i++)
{
vector<int> now ;
for(int j = i - k - 1 ; j <= i ; j++)
now.push_back(arr_r[j]) ;
arr_r_k1.push_back(add_xor({add_xor(now), add_or(now)})) ;
}
int num1 = add_and({add_or(arr_r_k1), add_or(arr_l_k1)}), num2 = add_and({add_or(arr_r_k), add_or(arr_l_k)}) ;
add_xor({num1, num2}) ;
}
//signed main()
//{
// int t ;
// cin >> t ;
// while(t--)
// {
// int n, m ;
// cin >> n >> m ;
// }
// return 0 ;
//}
Compilation message
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:49:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
49 | for(int i = k ; i < arr_l.size() ; i++)
| ~~^~~~~~~~~~~~~~
vision.cpp:56:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
56 | for(int i = k + 1 ; i < arr_l.size() ; i++)
| ~~^~~~~~~~~~~~~~
vision.cpp:87:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
87 | for(int i = k ; i < arr_r.size() ; i++)
| ~~^~~~~~~~~~~~~~
vision.cpp:94:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
94 | for(int i = k + 1 ; i < arr_r.size() ; i++)
| ~~^~~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 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 |
0 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 |
0 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 |
0 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 |
2 ms |
468 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 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
1360 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 |
0 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |