답안 #1071317

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1071317 2024-08-23T06:40:26 Z pcc Vision Program (IOI19_vision) C++17
14 / 100
7 ms 1216 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

#define pii pair<int,int>
#define fs first
#define sc second

int H,W,K;

int encode(int r,int c){
	return r*W+c;
}
pii decode(int k){
	return pii(k/W,k%W);
}


void construct_network(int HH, int WW, int KK) {
	H = HH,W = WW,K = KK;
	int zero = add_xor({0,0});
	vector<int> row,col;
	for(int i = 0;i<H;i++){
		vector<int> v;
		for(int j = 0;j<W;j++)v.push_back(encode(i,j));
		row.push_back(add_or(v));
	}
	for(int i = 0;i<W;i++){
		vector<int> v;
		for(int j = 0;j<H;j++)v.push_back(encode(j,i));
		col.push_back(add_or(v));
	}
	int t1 = add_xor(row);
	{
		int tmp = zero;
		for(int i = 0;i+1<W;i++){
			tmp = add_or({tmp,add_and({col[i],col[i+1]})});
		}
		t1 = add_and({t1,tmp});
	}

	//same col

	int t2 = add_xor(col);
	{
		int tmp = zero;
		for(int i = 0;i+1<H;i++){
			tmp = add_or({tmp,add_and({row[i],row[i+1]})});
		}
		t2 = add_and({t2,tmp});
	}

	add_or({t1,t2});
	return;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 504 KB Output is correct
2 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 1216 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 408 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 3 ms 860 KB Output is correct
8 Correct 3 ms 856 KB Output is correct
9 Correct 5 ms 1208 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -