Submission #172091

# Submission time Handle Problem Language Result Execution time Memory
172091 2019-12-31T05:58:17 Z dsjong Vision Program (IOI19_vision) C++14
0 / 100
10 ms 1216 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

int H,W,K;
int get(int x,int y){
	return x*W+y;
}
void construct_network(int h, int w, int k) {
	H=h, W=w, K=k;
	vector<int> Ns;
	vector<int>v1,v2,v1a,v2a;
	int ans1,ans2,ans3,ans4,ans5,ans6,ans7;
	for(int i=0;i<H;i++){
		Ns.clear();
		for(int j=0;j<W;j++){
			Ns.push_back(get(i,j));
		}
		v1.push_back(add_or(Ns));
	}
	for(int i=0;i<W;i++){
		Ns.clear();
		for(int j=0;j<H;j++){
			Ns.push_back(get(j,i));
		}
		v2.push_back(add_or(Ns));
	}
	ans1=add_xor(v1);
	ans2=add_xor(v2);
	for(int i=1;i<v1.size();i++){
		Ns={v1[i],v1[i-1]};
		v1a.push_back(add_and(Ns));
	}
	for(int i=1;i<v2.size();i++){
		Ns={v2[i],v2[i-1]};
		v2a.push_back(add_and(Ns));
	}
	ans3=add_or(v1a);
	ans4=add_or(v2a);
	Ns={ans1,ans2};
	ans5=add_xor(Ns);
	Ns={ans3,ans4};
	ans6=add_xor(Ns);
	Ns={ans5,ans6};
	ans7=add_and(Ns);
	return;
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:30:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1;i<v1.size();i++){
              ~^~~~~~~~~~
vision.cpp:34:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1;i<v2.size();i++){
              ~^~~~~~~~~~
vision.cpp:13:36: warning: variable 'ans7' set but not used [-Wunused-but-set-variable]
  int ans1,ans2,ans3,ans4,ans5,ans6,ans7;
                                    ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 380 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 1216 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 3 ms 376 KB Output is correct
4 Correct 3 ms 504 KB Output is correct
5 Incorrect 2 ms 400 KB WA in grader: Instruction with no inputs
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -