Submission #979079

# Submission time Handle Problem Language Result Execution time Memory
979079 2024-05-10T07:54:49 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--;
		}
		if (Ns.size()==0) continue;
		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:72:6: warning: unused variable 'b' [-Wunused-variable]
   72 |  int b = add_and(output);
      |      ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 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 0 ms 348 KB Output is correct
9 Incorrect 0 ms 348 KB on inputs (0, 1), (1, 1), expected 0, but computed 1
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 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 0 ms 348 KB Output is correct
9 Incorrect 0 ms 348 KB on inputs (0, 1), (1, 1), expected 0, but computed 1
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 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 0 ms 348 KB Output is correct
9 Incorrect 0 ms 348 KB on inputs (0, 1), (1, 1), expected 0, but computed 1
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 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 0 ms 348 KB Output is correct
9 Incorrect 0 ms 348 KB on inputs (0, 1), (1, 1), expected 0, but computed 1
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Incorrect 0 ms 344 KB on inputs (0, 1), (0, 2), expected 0, but computed 1
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 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 9 ms 1500 KB Output is correct
6 Correct 4 ms 984 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Incorrect 1 ms 984 KB WA in grader: Too many instructions
9 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 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 344 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 0 ms 348 KB Output is correct
9 Incorrect 0 ms 348 KB on inputs (0, 1), (1, 1), expected 0, but computed 1
10 Halted 0 ms 0 KB -