답안 #971726

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
971726 2024-04-29T08:18:16 Z Nahian9696 Vision Program (IOI19_vision) C++17
0 / 100
2 ms 1072 KB
#include <bits/stdc++.h>
#include "vision.h"

using namespace std;

int w, h, k;

int get_pixel(int i, int j) {
	return i*w + j;
}

void construct_network(int H, int W, int K) {
	w = W;
	h = H;
	k = K;
	std::vector<int> Ns;
	std::vector<int> Ns2;
	std::vector<int> Ns_final;

	for(int i = 0; i < H; i++) {
		for(int j = 0; j < W; j++) {
			
			// DO the diamond

			for(int k = i; k < H; k++) {
				int delt = K - abs(i - k);
				if(delt < 0) continue;
				int l = j + delt;
				if(abs(i - k) + abs(j-l) == K)
				if(l >= 0 && l < W) {
					Ns.push_back(get_pixel(k, l));
				}
				l = j - delt;
				if(abs(i - k) + abs(j-l) == K)
				if(l >= 0 && l < W) {
					Ns.push_back(get_pixel(k, l));
				}
			}
			Ns2.push_back(add_or(Ns));
			Ns2.push_back(get_pixel(i, j));

			Ns_final.push_back(add_and(Ns2));

			Ns.clear();
			Ns2.clear();
		}
	}

	// for(int i = H*W; i <= mx; i++) {
	// 	// cout << i << " ";
	// 	Ns.push_back(i);
	// }
	// // cout << endl;

	// cout << "Ns.size() = " << Ns.size() << endl;

	int a = add_or(Ns_final);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:57:6: warning: unused variable 'a' [-Wunused-variable]
   57 |  int a = add_or(Ns_final);
      |      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB WA in grader: Instruction with no inputs
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1072 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 348 KB WA in grader: Instruction with no inputs
3 Halted 0 ms 0 KB -