Submission #981182

# Submission time Handle Problem Language Result Execution time Memory
981182 2024-05-13T01:24:19 Z WongYiKai Vision Program (IOI19_vision) C++14
58 / 100
62 ms 6732 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

void construct_network(int H, int W, int K) {
	map<int,vector<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) right[-j].push_back(y*W+x);
			y++;
			x++;
		}
		//int a = add_or(n);
		//int b = add_xor(n);
		//right[-j] = n;
	}
	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) left[j].push_back(y*W+x);
			y++;
			x--;
		}
		//int a = add_or(n);
		//int b = add_xor(n);
		//left[j] = n;
	}
	vector<int> temp,temp2;
	for (int i=H-1;i>-W-K;i--){
		vector<int> n;
		for (int j=i+K;j>=i;j--){
			for (auto item:right[j]) n.push_back(item);
		}
		int a = add_or(n);
		int b = add_xor(n);
		int c = add_not(b);
		int d = add_and({a,c});
		temp.push_back(d);
	}
	for (int i=0;i<W+H+K-1;i++){
		vector<int> n;
		for (int j=i;j>=i-K;j--){
			for (auto item:left[j]) n.push_back(item);
		}
		int a = add_or(n);
		int b = add_xor(n);
		int c = add_not(b);
		int d = add_and({a,c});
		temp2.push_back(d);
	}
	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;
		for (int j=i+K-1;j>=i;j--){
			for (auto item:right[j]) n.push_back(item);
		}
		int a = add_or(n);
		int b = add_xor(n);
		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;
		for (int j=i;j>i-K;j--){
			for (auto item:left[j]) n.push_back(item);
		}
		int a = add_or(n);
		int b = add_xor(n);
		int c = add_not(b);
		int d = add_and({a,c});
		temp2.push_back(d);
	}
	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});
		
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:85:6: warning: unused variable 'aa' [-Wunused-variable]
   85 |  int aa = add_and({e,e3});
      |      ^~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 2 ms 348 KB Output is correct
27 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 2 ms 348 KB Output is correct
27 Correct 2 ms 348 KB Output is correct
28 Correct 9 ms 1372 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 440 KB Output is correct
31 Correct 14 ms 1628 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 2 ms 604 KB Output is correct
34 Correct 9 ms 1264 KB Output is correct
35 Correct 17 ms 2548 KB Output is correct
36 Correct 27 ms 3064 KB Output is correct
37 Correct 32 ms 3636 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 2 ms 348 KB Output is correct
27 Correct 2 ms 348 KB Output is correct
28 Correct 9 ms 1372 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 440 KB Output is correct
31 Correct 14 ms 1628 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 2 ms 604 KB Output is correct
34 Correct 9 ms 1264 KB Output is correct
35 Correct 17 ms 2548 KB Output is correct
36 Correct 27 ms 3064 KB Output is correct
37 Correct 32 ms 3636 KB Output is correct
38 Incorrect 4 ms 4440 KB WA in grader: Too many inputs
39 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 600 KB Output is correct
2 Correct 15 ms 1752 KB Output is correct
3 Correct 15 ms 2008 KB Output is correct
4 Correct 30 ms 3276 KB Output is correct
5 Correct 2 ms 604 KB Output is correct
6 Correct 11 ms 1496 KB Output is correct
7 Correct 20 ms 2264 KB Output is correct
8 Correct 29 ms 3284 KB Output is correct
9 Correct 2 ms 600 KB Output is correct
10 Correct 8 ms 1116 KB Output is correct
11 Correct 15 ms 2008 KB Output is correct
12 Correct 16 ms 2008 KB Output is correct
13 Correct 29 ms 2652 KB Output is correct
14 Correct 30 ms 3288 KB Output is correct
15 Correct 2 ms 604 KB Output is correct
16 Correct 9 ms 1372 KB Output is correct
17 Correct 15 ms 2008 KB Output is correct
18 Correct 15 ms 2008 KB Output is correct
19 Correct 29 ms 2480 KB Output is correct
20 Correct 30 ms 3288 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 0 ms 600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 4 ms 856 KB Output is correct
4 Correct 62 ms 6732 KB Output is correct
5 Incorrect 4 ms 4700 KB WA in grader: Too many inputs
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 41 ms 6064 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 4 ms 860 KB Output is correct
4 Correct 8 ms 1116 KB Output is correct
5 Correct 2 ms 604 KB Output is correct
6 Correct 2 ms 604 KB Output is correct
7 Correct 21 ms 3096 KB Output is correct
8 Correct 21 ms 3276 KB Output is correct
9 Correct 41 ms 5848 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 1 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 1 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 1 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 1 ms 348 KB Output is correct
24 Correct 1 ms 348 KB Output is correct
25 Correct 1 ms 348 KB Output is correct
26 Correct 2 ms 348 KB Output is correct
27 Correct 2 ms 348 KB Output is correct
28 Correct 9 ms 1372 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 440 KB Output is correct
31 Correct 14 ms 1628 KB Output is correct
32 Correct 1 ms 348 KB Output is correct
33 Correct 2 ms 604 KB Output is correct
34 Correct 9 ms 1264 KB Output is correct
35 Correct 17 ms 2548 KB Output is correct
36 Correct 27 ms 3064 KB Output is correct
37 Correct 32 ms 3636 KB Output is correct
38 Incorrect 4 ms 4440 KB WA in grader: Too many inputs
39 Halted 0 ms 0 KB -