| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 165929 | keta_tsimakuridze | Vision Program (IOI19_vision) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "vision.h"
using namespace std;
vector<int>V;
int ans(){
return add_or(V);
}
void construct_network(int h, int w, int K){
vector<int> Dr[405],Dl[405];
int cur,diag[405],d[450],a,b,k;
for(int i=0;i<w;i++)
for(int j=0;j<h;j++){
Dr[i-j+h-1].push_back(i*w+j);
}
for(int i=0;i<w;i++)
for(int j=0;j<h;j++){
Dl[i+j].push_back(i*w+j);
}
for(int i=w+h-1;i>=0;i--){
diag[i]=add_or(add_or(Dr[i]),diag[i+1]);
b=0;
if(i+k<=w+h-1){
a=add_and(diag[i+k],add_or(Dr[i]););
}
if(i+k<=w+h-2)
b=add_and(diag[i+k+1],add_or(Dr[i]););
V.push_back(add_xor(b,a));
}
for(int i=0;i<=w+h-1;i++){
cur=add_or(Dl[i]);
d[i]=add_or(cur,d[max(0,i-1)]);
b=0;
if(i-k>=0){
a=add_and(d[i-k],cur);
}
if(i-k-1>=0)
b=add_and(d[i-k-1],cur);
V.push_back(add_xor(b,a));
}
ans();
}
