Submission #979078

# Submission time Handle Problem Language Result Execution time Memory
979078 2024-05-10T07:53:41 Z WongYiKai Vision Program (IOI19_vision) C++14
0 / 100
14 ms 2004 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

void construct_network(int H, int W, int K) {
	vector<int> Ns;
	vector<int> output;
	int count=0;
	for (int i=0;i<H*W;i++){
		Ns.clear();
		int x=K+i%W,y=i/W;
		//cout << "loop " << x << " " << y << "\n";
		while (x>=W){
			x--;
			y++;
		}
		while (x>=i%W&&y<H&&y>=0){
			//Ns = {i,y*W+x};
			//cout << i << " " << y*W+x << "\n";
			Ns.push_back(y*W+x);
			x--;
			y++;
		}
		x=i%W-K;
		y=i/W;
		//cout << "loop " << x << " " << y << "\n";
		while (x<0){
			x++;
			y++;
		}
		while (x<i%W&&y<H&&y>=0){
			//Ns = {i,y*W+x};
			//cout << i << " " << y*W+x << "\n";
			Ns.push_back(y*W+x);
			x++;
			y++;
		}
		x=K+i%W-1,y=i/W-1;
		//cout << "loop " << x << " " << y << "\n";
		while (x>=W){
			x--;
			y--;
		}
		while (x>=i%W&&y<H&&y>=0){
			//Ns = {i,y*W+x};
			//cout << i << " " << y*W+x << "\n";
			Ns.push_back(y*W+x);
			x--;
			y--;
		}
		x=i%W-K+1;
		y=i/W-1;
		//cout << "loop " << x << " " << y << "\n";
		while (x<0){
			x++;
			y--;
		}
		while (x<i%W&&y<H&&y>=0){
			//Ns = {i,y*W+x};
			//cout << i << " " << y*W+x << "\n";
			Ns.push_back(y*W+x);
			x++;
			y--;
		}
		int c = add_not(i);
		int d = add_or(Ns);
		int e = add_or({c,d});
		output.push_back(e);
		count += Ns.size()+3;
	}
	int b = add_and(output);
	count++;
	//cout << "count " << count << "\n";
	return;
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:71:6: warning: unused variable 'b' [-Wunused-variable]
   71 |  int b = add_and(output);
      |      ^
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 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 -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 428 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 4 ms 984 KB Output is correct
4 Correct 14 ms 2004 KB Output is correct
5 Correct 10 ms 1492 KB Output is correct
6 Incorrect 1 ms 432 KB WA in grader: Instruction with no inputs
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 984 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 -