답안 #538493

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
538493 2022-03-17T03:15:41 Z WongChun1234 Vision Program (IOI19_vision) C++14
73 / 100
20 ms 2688 KB
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
const int MAXN=250;
int xo[MAXN],yo[MAXN],curr[10],tmpc[10],kval[10],ktmp[10],TRUE,FALSE;
vector<int> tmp;

void output(int var){
	add_not({add_not({var})});
}

void construct_network(int H, int W, int K) {
	// TODO: implementation
	for (int i=0;i<H;i++){
		tmp.clear();
		for (int j=0;j<W;j++) tmp.push_back(i*W+j);
		xo[i]=add_xor(tmp);
	}
	for (int j=0;j<W;j++){
		tmp.clear();
		for (int i=0;i<H;i++) tmp.push_back(i*W+j);
		yo[j]=add_xor(tmp);
	}
	tmp.clear();
	for (int i=0;i<H;i++) for (int j=0;j<W;j++) tmp.push_back(i*W+j);
	FALSE=add_xor(tmp);
	for (int i=0;i<=8;i++) curr[i]=FALSE,tmpc[i]=FALSE,kval[i]=FALSE;
	TRUE=add_or(tmp);
	//partial xor
	for (int i=1;i<H;i++) xo[i]=add_xor({xo[i-1],xo[i]});
	for (int i=1;i<W;i++) yo[i]=add_xor({yo[i-1],yo[i]});
	//calculator
	for (int i=0;i<H;i++){
		tmpc[0]=xo[i];
		for (int j=0;j<=8;j++){
			tmpc[j+1]=add_and({curr[j],tmpc[j]});
			curr[j]=add_xor({curr[j],tmpc[j]});
		}
	}
	for (int i=0;i<W;i++){
		tmpc[0]=yo[i];
		for (int j=0;j<=8;j++){
			tmpc[j+1]=add_and({curr[j],tmpc[j]});
			curr[j]=add_xor({curr[j],tmpc[j]});
		}
	}
	//k calculator
	for (int i=0;i<K;i++){
		tmpc[0]=TRUE;
		for (int j=0;j<=8;j++){
			tmpc[j+1]=add_and({kval[j],tmpc[j]});
			kval[j]=add_xor({kval[j],tmpc[j]});
		}
	}
	//output(kval[0]);
	//return;
	tmp.clear();
	for (int i=0;i<=8;i++) tmp.push_back(add_xor({curr[i],kval[i]}));
	TRUE=add_or(tmp);
	add_not(TRUE);
}
/*
2 3 3
0 0 1 2
0 2 1 0
*/
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 308 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 304 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 304 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 300 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 304 KB Output is correct
16 Correct 1 ms 224 KB Output is correct
17 Correct 1 ms 304 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 308 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 304 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 304 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 300 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 304 KB Output is correct
16 Correct 1 ms 224 KB Output is correct
17 Correct 1 ms 304 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 308 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 308 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 304 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 304 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 300 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 304 KB Output is correct
16 Correct 1 ms 224 KB Output is correct
17 Correct 1 ms 304 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 308 KB Output is correct
28 Correct 1 ms 468 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 304 KB Output is correct
31 Correct 2 ms 468 KB Output is correct
32 Correct 1 ms 380 KB Output is correct
33 Correct 2 ms 340 KB Output is correct
34 Correct 2 ms 468 KB Output is correct
35 Correct 2 ms 468 KB Output is correct
36 Correct 2 ms 468 KB Output is correct
37 Correct 2 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 308 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 304 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 304 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 300 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 304 KB Output is correct
16 Correct 1 ms 224 KB Output is correct
17 Correct 1 ms 304 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 308 KB Output is correct
28 Correct 1 ms 468 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 304 KB Output is correct
31 Correct 2 ms 468 KB Output is correct
32 Correct 1 ms 380 KB Output is correct
33 Correct 2 ms 340 KB Output is correct
34 Correct 2 ms 468 KB Output is correct
35 Correct 2 ms 468 KB Output is correct
36 Correct 2 ms 468 KB Output is correct
37 Correct 2 ms 468 KB Output is correct
38 Correct 7 ms 1096 KB Output is correct
39 Correct 2 ms 468 KB Output is correct
40 Correct 2 ms 556 KB Output is correct
41 Correct 4 ms 684 KB Output is correct
42 Correct 5 ms 932 KB Output is correct
43 Correct 7 ms 980 KB Output is correct
44 Correct 7 ms 1188 KB Output is correct
45 Correct 7 ms 1184 KB Output is correct
46 Correct 8 ms 1284 KB Output is correct
47 Correct 8 ms 1224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 596 KB Output is correct
2 Correct 4 ms 688 KB Output is correct
3 Correct 4 ms 720 KB Output is correct
4 Correct 4 ms 848 KB Output is correct
5 Correct 3 ms 564 KB Output is correct
6 Correct 3 ms 688 KB Output is correct
7 Correct 3 ms 812 KB Output is correct
8 Correct 4 ms 848 KB Output is correct
9 Correct 2 ms 596 KB Output is correct
10 Correct 3 ms 596 KB Output is correct
11 Correct 3 ms 684 KB Output is correct
12 Correct 3 ms 720 KB Output is correct
13 Correct 4 ms 720 KB Output is correct
14 Correct 5 ms 848 KB Output is correct
15 Correct 2 ms 556 KB Output is correct
16 Correct 3 ms 596 KB Output is correct
17 Correct 3 ms 688 KB Output is correct
18 Correct 3 ms 720 KB Output is correct
19 Correct 4 ms 720 KB Output is correct
20 Correct 4 ms 848 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 3 ms 596 KB Output is correct
4 Correct 3 ms 596 KB Output is correct
5 Correct 4 ms 724 KB Output is correct
6 Correct 4 ms 804 KB Output is correct
7 Correct 4 ms 844 KB Output is correct
8 Correct 5 ms 816 KB Output is correct
9 Correct 5 ms 848 KB Output is correct
10 Correct 6 ms 936 KB Output is correct
11 Correct 6 ms 976 KB Output is correct
12 Correct 6 ms 1048 KB Output is correct
13 Correct 2 ms 560 KB Output is correct
14 Correct 3 ms 720 KB Output is correct
15 Correct 4 ms 720 KB Output is correct
16 Correct 4 ms 848 KB Output is correct
17 Correct 3 ms 596 KB Output is correct
18 Correct 3 ms 708 KB Output is correct
19 Correct 4 ms 848 KB Output is correct
20 Correct 13 ms 1708 KB Output is correct
21 Correct 12 ms 1708 KB Output is correct
22 Correct 12 ms 1796 KB Output is correct
23 Incorrect 2 ms 1452 KB WA in grader: Too many instructions
24 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 20 ms 2688 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 3 ms 596 KB Output is correct
4 Correct 5 ms 760 KB Output is correct
5 Correct 2 ms 596 KB Output is correct
6 Correct 4 ms 560 KB Output is correct
7 Correct 11 ms 1644 KB Output is correct
8 Correct 12 ms 1580 KB Output is correct
9 Correct 19 ms 2616 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 308 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 300 KB Output is correct
3 Correct 1 ms 308 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 300 KB Output is correct
6 Correct 1 ms 304 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 304 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 300 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 304 KB Output is correct
16 Correct 1 ms 224 KB Output is correct
17 Correct 1 ms 304 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 1 ms 340 KB Output is correct
23 Correct 1 ms 340 KB Output is correct
24 Correct 1 ms 340 KB Output is correct
25 Correct 1 ms 340 KB Output is correct
26 Correct 1 ms 340 KB Output is correct
27 Correct 1 ms 308 KB Output is correct
28 Correct 1 ms 468 KB Output is correct
29 Correct 1 ms 340 KB Output is correct
30 Correct 1 ms 304 KB Output is correct
31 Correct 2 ms 468 KB Output is correct
32 Correct 1 ms 380 KB Output is correct
33 Correct 2 ms 340 KB Output is correct
34 Correct 2 ms 468 KB Output is correct
35 Correct 2 ms 468 KB Output is correct
36 Correct 2 ms 468 KB Output is correct
37 Correct 2 ms 468 KB Output is correct
38 Correct 7 ms 1096 KB Output is correct
39 Correct 2 ms 468 KB Output is correct
40 Correct 2 ms 556 KB Output is correct
41 Correct 4 ms 684 KB Output is correct
42 Correct 5 ms 932 KB Output is correct
43 Correct 7 ms 980 KB Output is correct
44 Correct 7 ms 1188 KB Output is correct
45 Correct 7 ms 1184 KB Output is correct
46 Correct 8 ms 1284 KB Output is correct
47 Correct 8 ms 1224 KB Output is correct
48 Correct 3 ms 596 KB Output is correct
49 Correct 4 ms 688 KB Output is correct
50 Correct 4 ms 720 KB Output is correct
51 Correct 4 ms 848 KB Output is correct
52 Correct 3 ms 564 KB Output is correct
53 Correct 3 ms 688 KB Output is correct
54 Correct 3 ms 812 KB Output is correct
55 Correct 4 ms 848 KB Output is correct
56 Correct 2 ms 596 KB Output is correct
57 Correct 3 ms 596 KB Output is correct
58 Correct 3 ms 684 KB Output is correct
59 Correct 3 ms 720 KB Output is correct
60 Correct 4 ms 720 KB Output is correct
61 Correct 5 ms 848 KB Output is correct
62 Correct 2 ms 556 KB Output is correct
63 Correct 3 ms 596 KB Output is correct
64 Correct 3 ms 688 KB Output is correct
65 Correct 3 ms 720 KB Output is correct
66 Correct 4 ms 720 KB Output is correct
67 Correct 4 ms 848 KB Output is correct
68 Correct 1 ms 212 KB Output is correct
69 Correct 1 ms 212 KB Output is correct
70 Correct 1 ms 212 KB Output is correct
71 Correct 1 ms 212 KB Output is correct
72 Correct 3 ms 596 KB Output is correct
73 Correct 3 ms 596 KB Output is correct
74 Correct 4 ms 724 KB Output is correct
75 Correct 4 ms 804 KB Output is correct
76 Correct 4 ms 844 KB Output is correct
77 Correct 5 ms 816 KB Output is correct
78 Correct 5 ms 848 KB Output is correct
79 Correct 6 ms 936 KB Output is correct
80 Correct 6 ms 976 KB Output is correct
81 Correct 6 ms 1048 KB Output is correct
82 Correct 2 ms 560 KB Output is correct
83 Correct 3 ms 720 KB Output is correct
84 Correct 4 ms 720 KB Output is correct
85 Correct 4 ms 848 KB Output is correct
86 Correct 3 ms 596 KB Output is correct
87 Correct 3 ms 708 KB Output is correct
88 Correct 4 ms 848 KB Output is correct
89 Correct 13 ms 1708 KB Output is correct
90 Correct 12 ms 1708 KB Output is correct
91 Correct 12 ms 1796 KB Output is correct
92 Incorrect 2 ms 1452 KB WA in grader: Too many instructions
93 Halted 0 ms 0 KB -