답안 #259224

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
259224 2020-08-07T12:32:49 Z dsjong Vision Program (IOI19_vision) C++14
14 / 100
11 ms 1280 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;
	int ans1, ans2;
	vector<int>cur, dif;
	for(int i=0;i<H+W-1;i++){
		vector<int>diag;
		for(int j=0;j<H;j++){
			int k=i-j;
			if(0<=k && k<W) diag.push_back(get(j, k));
		}
		cur.push_back(add_xor(diag));
	}
	for(int i=1;i<cur.size();i++){
		dif.push_back(add_and({cur[i], cur[i-1]}));
	}
	ans1=add_or(dif);
	cur.clear();
	dif.clear();
	for(int i=-W+1;i<H;i++){
		vector<int>diag;
		for(int j=0;j<H;j++){
			int k=j-i;
			if(0<=k && k<W) diag.push_back(get(j, k));
		}
		cur.push_back(add_xor(diag));
	}
	for(int i=1;i<cur.size();i++){
		dif.push_back(add_and({cur[i], cur[i-1]}));
	}
	ans2=add_or(dif);
	add_and({ans1, ans2});
	return;
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:21:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1;i<cur.size();i++){
              ~^~~~~~~~~~~
vision.cpp:35:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1;i<cur.size();i++){
              ~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 0 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 0 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 0 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 0 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Incorrect 1 ms 384 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Incorrect 0 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 1280 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 5 ms 768 KB Output is correct
8 Correct 5 ms 768 KB Output is correct
9 Correct 10 ms 1280 KB Output is correct
10 Correct 1 ms 256 KB Output is correct
11 Correct 1 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Incorrect 0 ms 256 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -