답안 #1038765

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1038765 2024-07-30T07:20:03 Z AmirAli_H1 Vision Program (IOI19_vision) C++17
0 / 100
83 ms 8908 KB
// In the name of Allah

#include <bits/stdc++.h>
#include "vision.h"
using namespace std;

typedef		long long int			ll;
typedef		long double				ld;
typedef		pair<int, int>			pii;
typedef		pair<ll, ll>			pll;
typedef		complex<ld>				cld;

#define		all(x)					(x).begin(),(x).end()
#define		len(x)					((ll) (x).size())
#define		F						first
#define		S						second
#define		pb						push_back
#define		sep						' '
#define		endl					'\n'
#define		Mp						make_pair
#define		kill(x)					cout << x << '\n', exit(0)
#define		set_dec(x)				cout << fixed << setprecision(x);
#define		file_io(x,y)			freopen(x, "r", stdin); freopen(y, "w", stdout);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int maxlg = 9;

int n, m, k;
vector<int> ls1, ls2, vc;
vector<int> ls, lsx;

int GI(int i, int j) {
	return (i * m) + j;
}

void construct_network(int H, int W, int K) {
	n = H; m = W; k = K;
	
	for (int i = n - 1; i >= 0; i--) {
		vc.clear();
		for (int j = 0; j < n; j++) vc.pb(GI(i, j));
		if (len(ls1) >= 1) vc.pb(ls1.back());
		ls1.pb(add_xor(vc));
	}
	for (int j = m - 1; j >= 0; j--) {
		vc.clear();
		for (int i = 0; i < n; i++) vc.pb(GI(i, j));
		if (len(ls2) >= 1) vc.pb(ls2.back());
		ls2.pb(add_xor(vc));
	}
	
	for (int x : ls1) ls.pb(x);
	for (int x : ls2) ls.pb(x);
	for (int j = 0; j < maxlg; j++) {
		if (k & (1 << j)) lsx.pb(add_xor(ls));
		else lsx.pb(add_not(add_xor(ls)));
		
		vc.clear();
		ls1.clear(); ls2.clear();
		for (int i = 0; i < len(ls); i++) {
			vc.pb(ls[i]);
			ls1.pb(add_xor(vc));
		}
		for (int i = 0; i < len(ls); i++) {
			if (i == 0) ls2.pb(add_and({ls[i]}));
			else ls2.pb(add_and({ls[i], ls1[i - 1]}));
		}
		ls = ls2;
	}
	add_and(lsx);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 12 ms 2136 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 83 ms 8908 KB Output is correct
2 Incorrect 0 ms 436 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -