#include <bits/stdc++.h>
#include <cassert>
#include <string>
#include "vision.h"
using namespace std;
/// ---------------------------------------------------------------------------------
int res[1000010];
int convert (int x , int y , int n , int m){
return (x - 1) * m + y - 1;
}
int in_matrix (int i , int j , int n , int m){
return (i > 0 && j > 0 && i <= n && j <= m);
}
void construct_network(int n, int m, int k) {
int i , j , pi , pj , op;
vector <int> v;
op = 0;
for (i = 1 ; i <= n ; i++){
for (j = 1 ; j <= m ; j++){
v.clear();
for (pi = 0 ; pi <= k ; pi++){
pj = k - pi;
//if (in_matrix(i + pi , j + pj , n , m))
// v.push_back(convert(i + pi , j + pj , n , m));
//if (in_matrix(i + pi , j - pj , n , m))
// v.push_back(convert(i + pi , j - pj , n , m));
if (in_matrix(i - pi , j + pj , n , m))
v.push_back(convert(i - pi , j + pj , n , m));
if (in_matrix(i - pi , j - pj , n , m))
v.push_back(convert(i - pi , j - pj , n , m));
}
if (v.empty())
continue;
add_xor(v);
op++;
v.clear();
v.push_back(n * m + (op - 1));
v.push_back(convert(i , j , n , m));
add_and(v);
op++;
/// res[ceva impar] e rezultatul unui and
}
}
v.clear();
for (i = 1 ; i < op ; i += 2){
v.push_back(n * m + i);
}
add_or(v);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Incorrect |
5 ms |
512 KB |
on inputs (0, 0), (1, 0), expected 1, but computed 0 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Incorrect |
5 ms |
512 KB |
on inputs (0, 0), (1, 0), expected 1, but computed 0 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Incorrect |
5 ms |
512 KB |
on inputs (0, 0), (1, 0), expected 1, but computed 0 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Incorrect |
5 ms |
512 KB |
on inputs (0, 0), (1, 0), expected 1, but computed 0 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
256 KB |
Output is correct |
5 |
Incorrect |
6 ms |
384 KB |
on inputs (0, 0), (2, 0), expected 1, but computed 0 |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
256 KB |
on inputs (0, 0), (1, 0), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
1148 KB |
WA in grader: Too many instructions |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Incorrect |
5 ms |
512 KB |
on inputs (0, 0), (1, 0), expected 1, but computed 0 |
4 |
Halted |
0 ms |
0 KB |
- |