QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#525493 | #2674. Vision program | jamjanek | 0 | 13ms | 5364kb | C++20 | 2.2kb | 2024-08-20 17:07:25 | 2024-08-20 17:07:26 |
Judging History
answer
#include<bits/stdc++.h>
#include "vision.h"
using namespace std;
vector<int>skosy1[1010],skosy2[1010];
int n, m, k;
int zamien(int a,int b){
return a*m+b;
}
int zamien2(int typ, int ktore){
return n*m+2+typ*(n+m-1)+ktore;
}
void construct_network(int N, int M, int K) {
n = N, m = M, k = K;
add_not(0);
add_and({0,n*m});
// [n*2+1] 0
int i,j;
for(i=0;i<n;i++)
for(j=0;j<m;j++){
skosy1[i+j].push_back(zamien(i,j));
skosy2[-i+j+(n-1)].push_back(zamien(i,j));
}
//skosy 1 [S, S+ n+m-1)
//skosy 2 [S + n+m-1, S+ 2*(n+m)-2)
for(i=0;i<n+m-1;i++)
add_or(skosy1[i]);
for(i=0;i<n+m-1;i++)
add_or(skosy2[i]);
// [S+2*(n+m)-2, S+3*(n+m)-3) czy na sufixie od i po skosy1
// [S+3*(n+m)-3, S+4*(n+m)-4) czy na sufixie od i po skosy2
vector<int>pom;
for(i=n+m-1;i>=0;i--)
pom.push_back(zamien2(0,i));
for(i=0;i<n+m-1;i++){
add_or(pom);
pom.pop_back();
}
for(i=n+m-1;i>=0;i--)
pom.push_back(zamien2(1,i));
for(i=0;i<n+m-1;i++){
add_or(pom);
pom.pop_back();
}
// [S+4*(n+m)-4, S+5*(n+m)-5) czy m odleglosci k na prawo od i po skosy1
// [S+5*(n+m)-5, S+6*(n+m)-6) czy m odleglosci k na prawo od i po skosy2
for(i=0;i<n+m-1;i++){
if(i+k<n+m-1)pom = {zamien2(0,i),zamien2(0,i+k)};
else pom = {n*m+1};
add_and(pom);
}
for(i=0;i<n+m-1;i++){
if(i+k<n+m-1)pom = {zamien2(1,i),zamien2(1,i+k)};
else pom = {n*m+1};
add_and(pom);
}
// [S+6*(n+m)-6, S+7*(n+m)-7) czy m odleglosci>= k+1 na prawo od i po skosy1
// [S+7*(n+m)-7, S+8*(n+m)-8) czy m odleglosci>= k+1 na prawo od i po skosy2
for(i=0;i<n+m-1;i++){
if(i+k+1<n+m-1)pom = {zamien2(0,i),zamien2(2,i+k+1)};
else pom = {n*m+1};
add_and(pom);
}
for(i=0;i<n+m-1;i++){
if(i+k<n+m-1)pom = {zamien2(1,i),zamien2(3,i+k+1)};
else pom = {n*m+1};
add_and(pom);
}
pom.clear();
for(i=0;i<n+m-1;i++)pom.push_back(zamien2(4,i));
for(i=0;i<n+m-1;i++)pom.push_back(zamien2(5,i));
int czy = add_or(pom);
pom.clear();
for(i=0;i<n+m-1;i++)pom.push_back(zamien2(6,i));
for(i=0;i<n+m-1;i++)pom.push_back(zamien2(7,i));
int czy_not = add_or(pom);
int not_czy_not = add_not(czy_not);
add_and({czy,not_czy_not});
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3872kb
input:
c2675211-ade0-44b0-8c15-741dd835f3d2 1 3 1 -1
output:
b17553fd-ba5a-4140-836c-491f938c515b OK 30 3 0 0 2 0 3 1 1 0 1 1 1 1 1 2 1 1 0 1 1 1 1 1 2 1 4 8 7 6 5 1 3 8 7 6 1 2 8 7 1 5 8 11 10 9 8 1 4 8 11 10 9 1 3 8 11 10 0 2 5 6 0 2 6 7 0 1 4 0 2 8 9 0 2 9 10 0 1 4 0 2 5 13 0 1 4 0 1 4 0 2 8 16 0 2 9 17 0 1 4 1 6 17 18 19 20 21 22 1 6 23 24 25 26 27 28 3 3...
result:
wrong answer on inputs (0, 0), (0, 1), expected 1, but computed 0
Subtask #2:
score: 0
Wrong Answer
Test #19:
score: 0
Wrong Answer
time: 0ms
memory: 3808kb
input:
c2675211-ade0-44b0-8c15-741dd835f3d2 1 9 3 -1
output:
b17553fd-ba5a-4140-836c-491f938c515b OK 78 3 0 0 2 0 9 1 1 0 1 1 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 0 1 1 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 10 20 19 18 17 16 15 14 13 12 11 1 9 20 19 18 17 16 15 14 13 12 1 8 20 19 18 17 16 15 14 13 1 7 20 19 18 17 16 15 14 1 6 20 19 18 17 16...
result:
wrong answer on inputs (0, 0), (0, 3), expected 1, but computed 0
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Wrong Answer
Test #48:
score: 0
Wrong Answer
time: 3ms
memory: 4116kb
input:
c2675211-ade0-44b0-8c15-741dd835f3d2 1 199 1 -1
output:
b17553fd-ba5a-4140-836c-491f938c515b OK 1598 3 0 0 2 0 199 1 1 0 1 1 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 1 13 1 1 14 1 1 15 1 1 16 1 1 17 1 1 18 1 1 19 1 1 20 1 1 21 1 1 22 1 1 23 1 1 24 1 1 25 1 1 26 1 1 27 1 1 28 1 1 29 1 1 30 1 1 31 1 1 32 1 1 33 1 1 34 1 1 35...
result:
wrong answer on inputs (0, 0), (0, 1), expected 1, but computed 0
Subtask #6:
score: 0
Wrong Answer
Test #70:
score: 0
Wrong Answer
time: 0ms
memory: 3820kb
input:
c2675211-ade0-44b0-8c15-741dd835f3d2 2 2 1 3 128 128 129 128 130 128 131
output:
b17553fd-ba5a-4140-836c-491f938c515b OK 30 3 0 0 2 0 4 1 1 0 1 2 1 2 1 1 3 1 1 2 1 2 0 3 1 1 1 1 4 9 8 7 6 1 3 9 8 7 1 2 9 8 1 5 9 12 11 10 9 1 4 9 12 11 10 1 3 9 12 11 0 2 6 7 0 2 7 8 0 1 5 0 2 9 10 0 2 10 11 0 1 5 0 2 6 14 0 1 5 0 1 5 0 2 9 17 0 2 10 18 0 1 5 1 6 18 19 20 21 22 23 1 6 24 25 26 27 ...
result:
wrong answer on inputs (0, 0), (0, 1), expected 1, but computed 0
Subtask #7:
score: 0
Wrong Answer
Test #101:
score: 0
Wrong Answer
time: 13ms
memory: 5364kb
input:
c2675211-ade0-44b0-8c15-741dd835f3d2 200 200 1 100 524 24804 34853 20956 34628 18830 29184 28919 32573 11364 24911 2226 5624 3715 30838 2206 17143 21162 27531 20198 27242 5007 12724 27160 32586 3535 7307 17015 25466 626 13891 9132 26194 9198 33073 815 7328 6938 21395 9489 30995 10804 21530 14698 394...
output:
b17553fd-ba5a-4140-836c-491f938c515b OK 3198 3 0 0 2 0 40000 1 1 0 1 2 1 200 1 3 2 201 400 1 4 3 202 401 600 1 5 4 203 402 601 800 1 6 5 204 403 602 801 1000 1 7 6 205 404 603 802 1001 1200 1 8 7 206 405 604 803 1002 1201 1400 1 9 8 207 406 605 804 1003 1202 1401 1600 1 10 9 208 407 606 805 1004 120...
result:
wrong answer on inputs (80, 199), (81, 199), expected 1, but computed 0
Subtask #8:
score: 0
Skipped
Dependency #1:
0%