답안 #166938

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
166938 2019-12-04T17:50:18 Z cfalas Vision Program (IOI19_vision) C++14
44 / 100
323 ms 26100 KB
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> ii;
#define mp(a,b) ii(min(a, b), max(a, b))

void construct_network(int H, int W, int K) {
	std::vector<int> Ns;
	map<ii, bool> used;
	for(int x1=0;x1<W;x1++){
		for(int y1=0;y1<H;y1++){
			//cout<<endl<<x1+W*y1<<": \n";
			int origx=K+x1, origy=y1;
			vector<int> possiblexy;
			for(int i=0;i<K;i++){
				//cout<<origx+origy*W<<" ";
				if(origx<W && origx>=0 && origy<H && origy>=0){
					if(!used[mp(origx+origy*W, y1*W+x1)] && !used[mp(y1*W+x1, origx+origy*W)]){
						used[mp(origx+origy*W, y1*W+x1)] = true;
						used[mp(y1*W+x1, origx+origy*W)] = true;
						possiblexy.push_back(origx+origy*W);
					}
				}
				origy++;
				origx--;
			}
			for(int i=0;i<K;i++){
				//cout<<origx+origy*W<<" ";
				if(origx<W && origx>=0 && origy<H && origy>=0){
					if(!used[mp(origx+origy*W, y1*W+x1)] && !used[mp(y1*W+x1, origx+origy*W)]){
						used[mp(origx+origy*W, y1*W+x1)] = true;
						used[mp(y1*W+x1, origx+origy*W)] = true;
						possiblexy.push_back(origx+origy*W);
					}
				}
				origy--;
				origx--;
			}
			for(int i=0;i<K;i++){
				//cout<<origx+origy*W<<" ";
				if(origx<W && origx>=0 && origy<H && origy>=0){
					if(!used[mp(origx+origy*W, y1*W+x1)] && !used[mp(y1*W+x1, origx+origy*W)]){
						used[mp(origx+origy*W, y1*W+x1)] = true;
						used[mp(y1*W+x1, origx+origy*W)] = true;
						possiblexy.push_back(origx+origy*W);
					}
				}
				origy--;
				origx++;
			}
			for(int i=0;i<K;i++){
				//cout<<origx+origy*W<<" ";
				if(origx<W && origx>=0 && origy<H && origy>=0){
					if(!used[mp(origx+origy*W, y1*W+x1)] && !used[mp(y1*W+x1, origx+origy*W)]){
						used[mp(origx+origy*W, y1*W+x1)] = true;
						used[mp(y1*W+x1, origx+origy*W)] = true;
						possiblexy.push_back(origx+origy*W);
					}
				}
				origy++;
				origx++;
			}
			int a;
			if(possiblexy.size()>1)
			a = add_or(possiblexy);
			else if(possiblexy.size()==1) a = possiblexy[0];
			else continue;
			vector<int> v;
			v.push_back(y1*W + x1);
			v.push_back(a);
			Ns.push_back(add_and(v));
		}
	}
	int a = add_or(Ns);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:74:6: warning: unused variable 'a' [-Wunused-variable]
  int a = add_or(Ns);
      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 252 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 348 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 252 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 348 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 256 KB Output is correct
20 Correct 2 ms 256 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 256 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 252 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 348 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 256 KB Output is correct
20 Correct 2 ms 256 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 256 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 256 KB Output is correct
28 Correct 16 ms 1532 KB Output is correct
29 Correct 2 ms 376 KB Output is correct
30 Correct 2 ms 256 KB Output is correct
31 Correct 2 ms 376 KB Output is correct
32 Correct 3 ms 504 KB Output is correct
33 Correct 4 ms 504 KB Output is correct
34 Correct 15 ms 1528 KB Output is correct
35 Correct 11 ms 1144 KB Output is correct
36 Correct 4 ms 504 KB Output is correct
37 Correct 2 ms 380 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 252 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 348 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 256 KB Output is correct
20 Correct 2 ms 256 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 256 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 256 KB Output is correct
28 Correct 16 ms 1532 KB Output is correct
29 Correct 2 ms 376 KB Output is correct
30 Correct 2 ms 256 KB Output is correct
31 Correct 2 ms 376 KB Output is correct
32 Correct 3 ms 504 KB Output is correct
33 Correct 4 ms 504 KB Output is correct
34 Correct 15 ms 1528 KB Output is correct
35 Correct 11 ms 1144 KB Output is correct
36 Correct 4 ms 504 KB Output is correct
37 Correct 2 ms 380 KB Output is correct
38 Incorrect 323 ms 26100 KB WA in grader: Too many instructions
39 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 256 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 256 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 9 ms 1140 KB Output is correct
4 Correct 67 ms 5620 KB Output is correct
5 Correct 43 ms 3444 KB Output is correct
6 Correct 15 ms 1528 KB Output is correct
7 Correct 4 ms 376 KB Output is correct
8 Incorrect 10 ms 1684 KB WA in grader: Too many instructions
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 1780 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 252 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 348 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 256 KB Output is correct
20 Correct 2 ms 256 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 256 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 2 ms 376 KB Output is correct
27 Correct 2 ms 256 KB Output is correct
28 Correct 16 ms 1532 KB Output is correct
29 Correct 2 ms 376 KB Output is correct
30 Correct 2 ms 256 KB Output is correct
31 Correct 2 ms 376 KB Output is correct
32 Correct 3 ms 504 KB Output is correct
33 Correct 4 ms 504 KB Output is correct
34 Correct 15 ms 1528 KB Output is correct
35 Correct 11 ms 1144 KB Output is correct
36 Correct 4 ms 504 KB Output is correct
37 Correct 2 ms 380 KB Output is correct
38 Incorrect 323 ms 26100 KB WA in grader: Too many instructions
39 Halted 0 ms 0 KB -