QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#351134#2674. Vision programCyanmond0 2ms4352kbC++201.9kb2024-03-11 16:50:192024-03-11 16:50:19

Judging History

你现在查看的是最新测评结果

  • [2024-03-11 16:50:19]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:4352kb
  • [2024-03-11 16:50:19]
  • 提交

answer

#include "vision.h"
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

template <class T> using Vec = std::vector<T>;
#define L(i, l, r) for (int i = (l); i < (r); ++i)
#define R(i, l, r) for (int i = (r - 1); i >= (l); --i)
#define ALL(x) (x).begin(), (x).end()
#define sz(x) (int)(x.size())

int startH, endH, startW, endW;

int startDisTableH, endDisTableH;
int startDisTableW, endDisTableW;
int startATableH, endATableH;
int startATableW, endATableW;

int nwId;

void construct_network(int H, int W, int K) {
	nwId = H * W;
	startH = nwId;
	endH = nwId + H;
	nwId += H;
	L(i, 0, H) {
		Vec<int> ns;
		L(j, 0, W) ns.push_back(i * W + j);
		add_or(ns);
	}
	startW = nwId;
	endW = nwId + W;
	nwId += W;
	L(j, 0, W) {
		Vec<int> ns;
		L(i, 0, H) ns.push_back(i * W + j);
		add_or(ns);
	}

	startDisTableH = nwId, endDisTableH = nwId + H * (H + 1) / 2;
	L(i, 0, H) L(j, i, H) {
		if (i == j) add_or({startH + i});
		else add_and({startH + i, startH + j});
	}
	nwId += H * (H + 1) / 2;
	startDisTableW = nwId, endDisTableW = nwId += W * (W + 1) / 2;
	L(i, 0, W) L(j, i, W) {
		if (i == j) add_or({startW + i});
		else add_and({startW + i, startW + j});
	}
	startATableH = nwId, endATableH = nwId += H;
	L(i, 0, H) {
		Vec<int> ns;
		int cnt = 0;
		L(a, 0, H) L(b, a, H) {
			if (b - a == i) ns.push_back(startDisTableH + cnt);
			++cnt;
		}
		add_or(ns);
	}
	startATableW = nwId, endATableW = nwId += W;
	L(i, 0, W) {
		Vec<int> ns;
		int cnt = 0;
		L(a, 0, W) L(b, a, W) {
			if (b - a == i) ns.push_back(startDisTableW + cnt);
			++cnt;
		}
		add_or(ns);
	}

	int startX = nwId;
	L(i, 0, H) {
		L(j, 0, W) {
			if (i + j == K) {
				Vec<int> ns = {startATableH + i, startATableW + j};
				add_and(ns);
				++nwId;
			}
		}
	}
	Vec<int> ns;
	L(i, startX, nwId) ns.push_back(i);
	add_or(ns);
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 10
Accepted
time: 1ms
memory: 3740kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 3 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
17
1 3 0 1 2
1 1 0
1 1 1
1 1 2
1 1 3
1 1 4
0 2 4 5
0 2 4 6
1 1 5
0 2 5 6
1 1 6
1 1 7
1 3 8 11 13
1 2 9 12
1 1 10
0 2 14 16
1 1 18

result:

ok 

Test #2:

score: 0
Accepted
time: 0ms
memory: 3788kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 3 2
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
17
1 3 0 1 2
1 1 0
1 1 1
1 1 2
1 1 3
1 1 4
0 2 4 5
0 2 4 6
1 1 5
0 2 5 6
1 1 6
1 1 7
1 3 8 11 13
1 2 9 12
1 1 10
0 2 14 17
1 1 18

result:

ok 

Test #3:

score: 0
Accepted
time: 1ms
memory: 3788kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
3 1 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
17
1 1 0
1 1 1
1 1 2
1 3 0 1 2
1 1 3
0 2 3 4
0 2 3 5
1 1 4
0 2 4 5
1 1 5
1 1 6
1 3 7 10 12
1 2 8 11
1 1 9
1 1 13
0 2 15 17
1 1 18

result:

ok 

Test #4:

score: 0
Accepted
time: 1ms
memory: 4064kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
3 1 2
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
17
1 1 0
1 1 1
1 1 2
1 3 0 1 2
1 1 3
0 2 3 4
0 2 3 5
1 1 4
0 2 4 5
1 1 5
1 1 6
1 3 7 10 12
1 2 8 11
1 1 9
1 1 13
0 2 16 17
1 1 18

result:

ok 

Test #5:

score: -10
Wrong Answer
time: 0ms
memory: 3780kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
2 2 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
17
1 2 0 1
1 2 2 3
1 2 0 2
1 2 1 3
1 1 4
0 2 4 5
1 1 5
1 1 6
0 2 6 7
1 1 7
1 2 8 10
1 1 9
1 2 11 13
1 1 12
0 2 14 17
0 2 15 16
1 2 18 19

result:

wrong answer on inputs (0, 1), (1, 0), expected 0, but computed 1

Subtask #2:

score: 0
Wrong Answer

Test #19:

score: 11
Accepted
time: 0ms
memory: 3792kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 9 3
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
68
1 9 0 1 2 3 4 5 6 7 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 1 9
1 1 10
0 2 10 11
0 2 10 12
0 2 10 13
0 2 10 14
0 2 10 15
0 2 10 16
0 2 10 17
0 2 10 18
1 1 11
0 2 11 12
0 2 11 13
0 2 11 14
0 2 11 15
0 2 11 16
0 2 11 17
0 2 11 18
1 1 12
0 2 ...

result:

ok 

Test #20:

score: 0
Accepted
time: 1ms
memory: 3756kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
9 1 5
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
68
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 9 0 1 2 3 4 5 6 7 8
1 1 9
0 2 9 10
0 2 9 11
0 2 9 12
0 2 9 13
0 2 9 14
0 2 9 15
0 2 9 16
0 2 9 17
1 1 10
0 2 10 11
0 2 10 12
0 2 10 13
0 2 10 14
0 2 10 15
0 2 10 16
0 2 10 17
1 1 11
0 2 11 12
0 2 11 13...

result:

ok 

Test #21:

score: -11
Wrong Answer
time: 1ms
memory: 3800kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
10 5 2
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
104
1 5 0 1 2 3 4
1 5 5 6 7 8 9
1 5 10 11 12 13 14
1 5 15 16 17 18 19
1 5 20 21 22 23 24
1 5 25 26 27 28 29
1 5 30 31 32 33 34
1 5 35 36 37 38 39
1 5 40 41 42 43 44
1 5 45 46 47 48 49
1 10 0 5 10 15 20 25 30 35 40 45
1 10 1 6 11 16 21 26 31 36 41 46
1 10 2 7 1...

result:

wrong answer on inputs (0, 2), (1, 0), expected 0, but computed 1

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: 2ms
memory: 4040kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
1 199 1
-1

output:

b17553fd-ba5a-4140-836c-491f938c515b
WA
Too many instructions

result:

wrong answer WA in grader: Too many instructions

Subtask #6:

score: 0
Wrong Answer

Test #70:

score: 0
Wrong Answer
time: 1ms
memory: 3780kb

input:

c2675211-ade0-44b0-8c15-741dd835f3d2
2 2 1
3 128
128 129
128 130
128 131

output:

b17553fd-ba5a-4140-836c-491f938c515b
OK
17
1 2 0 1
1 2 2 3
1 2 0 2
1 2 1 3
1 1 4
0 2 4 5
1 1 5
1 1 6
0 2 6 7
1 1 7
1 2 8 10
1 1 9
1 2 11 13
1 1 12
0 2 14 17
0 2 15 16
1 2 18 19

result:

wrong answer on inputs (0, 0), (1, 1), expected 0, but computed 1

Subtask #7:

score: 0
Wrong Answer

Test #101:

score: 0
Wrong Answer
time: 2ms
memory: 4352kb

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
WA
Too many instructions

result:

wrong answer WA in grader: Too many instructions

Subtask #8:

score: 0
Skipped

Dependency #1:

0%