이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K) {
int count=0,count2=0;
map<int,pair<int,int>> left,right;
for (int j=-H+1;j<W;j++){
vector<int> n;
int x=j,y=0;
while (y<H){
if (x>=0&&x<W) n.push_back(y*W+x);
y++;
x++;
}
count += 2;
count2 += n.size()*2;
int a = add_or(n);
int b = add_xor(n);
right[-j] = {a,b};
}
for (int j=0;j<W+H-1;j++){
vector<int> n;
int x=j,y=0;
while (y<H){
if (x>=0&&x<W) n.push_back(y*W+x);
y++;
x--;
}
count += 2;
count2 += n.size()*2;
int a = add_or(n);
int b = add_xor(n);
left[j] = {a,b};
}
vector<int> temp,temp2;
for (int i=H-1-K;i>-W;i--){
vector<int> n,n2;
for (int j=i+K;j>=i;j--){
if (right[j].first==right[j].second) continue;
n.push_back(right[j].first);
n2.push_back(right[j].second);
}
count += 4;
count2 += n.size()+n2.size()+3;
int a = add_or(n);
int b = add_xor(n2);
int c = add_not(b);
int d = add_and({a,c});
temp.push_back(d);
}
for (int i=K;i<W+H-1;i++){
vector<int> n,n2;
for (int j=i;j>=i-K;j--){
if (left[j].first==left[j].second) continue;
n.push_back(left[j].first);
n2.push_back(left[j].second);
}
count += 4;
count2 += n.size()*2+3;
int a = add_or(n);
int b = add_xor(n2);
int c = add_not(b);
int d = add_and({a,c});
temp2.push_back(d);
}
count += 3;
count2 += temp.size()+temp2.size()+2;
int a = add_or(temp);
int b = add_or(temp2);
int e = add_and({a,b});
temp.clear();
temp2.clear();
for (int i=H-1;i>-W-K+1;i--){
vector<int> n,n2;
for (int j=i+K-1;j>=i;j--){
if (right[j].first==right[j].second) continue;
n.push_back(right[j].first);
n2.push_back(right[j].second);
}
count += 4;
count2 += n.size()*2+3;
int a = add_or(n);
int b = add_xor(n2);
int c = add_not(b);
int d = add_and({a,c});
temp.push_back(d);
}
for (int i=0;i<W+H+K-2;i++){
vector<int> n,n2;
for (int j=i;j>i-K;j--){
if (left[j].first==left[j].second) continue;
n.push_back(left[j].first);
n2.push_back(left[j].second);
}
count += 4;
count2 += n.size()*2+3;
int a = add_or(n);
int b = add_xor(n2);
int c = add_not(b);
int d = add_and({a,c});
temp2.push_back(d);
}
count += 5;
count2 += temp.size() + temp2.size() + 5;
a = add_or(temp);
b = add_or(temp2);
int e2 = add_and({a,b});
int e3 = add_not(e2);
int aa = add_and({e,e3});
//cout << count << " " << count2 << "\n";
}
컴파일 시 표준 에러 (stderr) 메시지
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:110:6: warning: unused variable 'aa' [-Wunused-variable]
110 | int aa = add_and({e,e3});
| ^~
# | 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... |