답안 #172092

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
172092 2019-12-31T06:02:32 Z dsjong Vision Program (IOI19_vision) C++14
14 / 100
10 ms 1144 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);
	if(v1.size()==1){
		Ns={ans1,ans2};
		v1a.push_back(add_and(Ns));
	}
	else{
		for(int i=1;i<v1.size();i++){
			Ns={v1[i],v1[i-1]};
			v1a.push_back(add_and(Ns));
		}
	}
	if(v2.size()==1){
		Ns={ans1,ans2};
		v2a.push_back(add_and(Ns));
	}
	else{
		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:35:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i=1;i<v1.size();i++){
               ~^~~~~~~~~~
vision.cpp:45:16: 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;
                                    ^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 1144 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 376 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 3 ms 380 KB Output is correct
7 Correct 7 ms 764 KB Output is correct
8 Correct 6 ms 760 KB Output is correct
9 Correct 10 ms 1144 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -