답안 #955069

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
955069 2024-03-29T10:15:59 Z waldi Vision Program (IOI19_vision) C++17
12 / 100
9 ms 1220 KB
#include "vision.h"
#include <bits/stdc++.h>
#define FOR(i,p,k) for(int i=(p);i<=(k);++i)
#define REP(i,n) FOR(i,0,(n)-1)
#define ssize(x) (int((x).size()))
#define all(x) (x).begin(),(x).end()
using namespace std;

void construct_network(int h, int w, int k){
	if(min(h, w) == 1){
		vector<int> vec;
		REP(i, h) REP(j, w) REP(x, h) REP(y, w){
			if(abs(i-x)+abs(j-y) == k){
				int t = add_and({i*w+j, x*w+y});
				vec.emplace_back(t);
			}
		}
		add_or(vec);
		return;
	}
	
	if(1){
		vector<int> poziomo(h);
		REP(i, h){
			vector<int> vec;
			REP(j, w) vec.emplace_back(i*w+j);
			poziomo[i] = add_xor(vec);
		}
		
		vector<int> pionowo(w);
		REP(j, w){
			vector<int> vec;
			REP(i, h) vec.emplace_back(i*w+j);
			pionowo[j] = add_xor(vec);
		}
		
		auto roznica = [&](vector<int> vec, int delta){
			vector<int> ret;
			REP(i, ssize(vec)-delta) ret.emplace_back(add_and({vec[i], vec[i+delta]}));
			return add_or(ret);
		};
		
		vector<int> vec;
		FOR(i, 0, k) if(i<h && k-i<w) vec.emplace_back(add_and({roznica(poziomo, i), roznica(pionowo, k-i)}));
		add_or(vec);
		return;
	}
	
	/*vector<int> vec;
	REP(x, h) REP(y, w){
		if(x+y == k){
			int t = add_and({0, x*w+y});
			vec.emplace_back(t);
		}
	}
	add_or(vec);*/
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 344 KB Output is correct
15 Correct 1 ms 344 KB Output is correct
16 Correct 1 ms 344 KB Output is correct
17 Correct 1 ms 344 KB Output is correct
18 Correct 1 ms 344 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 344 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 9 ms 1220 KB on inputs (80, 199), (81, 199), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Incorrect 1 ms 348 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
6 Halted 0 ms 0 KB -