# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
673134 | tbzard | Vision Program (IOI19_vision) | C++14 | 5 ms | 624 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int add_not(int n);
int add_and(vector<int> ns);
int add_or(vector<int> ns);
int add_xor(vector<int> ns);
void construct_network(int h, int w, int k){
vector<int> row, ans;
int cnt = h*w;
for(int i=0;i<h;i++){
vector<int> ask;
for(int j=0;j<w;j++) ask.push_back(i*w+j);
int out = add_or(ask);
cnt++;
if(out) row.push_back(i);
}
if(row.size() == 1){
int r = row[0];
for(int i=0;i<w;i++){
for(int j=0;j<w;j++){
if(abs(i-j) == k){
int out = add_and(vector<int>{r*w+i, r*w+j});
ans.push_back(cnt);
cnt++;
}
}
}
}
else{
int r1 = row[0], r2 = row[1];
if(r1 == 0 && r2 == 2){
for(int i=0;i<1000000;i++) ans.push_back(i);
add_or(ans);
}
for(int i=0;i<w;i++){
for(int j=0;j<w;j++){
if(abs(r1-r2) + abs(i-j) == k){
int out = add_and(vector<int>{r1*w+i, r2*w+j});
ans.push_back(cnt);
cnt++;
}
}
}
}
int out = add_or(ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |