답안 #723860

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
723860 2023-04-14T11:31:11 Z GrandTiger1729 Vision Program (IOI19_vision) C++17
0 / 100
2 ms 1104 KB
#include "vision.h"
#ifndef EVAL
#include "grader.cpp"
#endif

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

void construct_network(int n, int m, int K){
	auto valid = [&](int i, int j) -> int {
		return 0 <= i && i < n && 0 <= j && j < m;
	};
	auto idx = [&](int i, int j) -> int {
		return i * m + j;
	};
	int ptr = n * m;
	vector<int> res;
	for (int i = 0; i < n; i++){
		for (int j = 0; j < m; j++){
			if (valid(i + K, j)){
				add_and({idx(i + K, j)});
				res.push_back(ptr++);
			}
			for (int k = 1; k <= K; k++){
				if (valid(i + (K - k), j - k)){
					add_and({idx(i, j), idx(i + (K - k), j - k)});
					res.push_back(ptr++);
				}
				if (valid(i + (K - k), j + k)){
					add_and({idx(i, j), idx(i + (K - k), j + k)});
					res.push_back(ptr++);
				}
			}
		}
	}
	add_or(res);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB on inputs (0, 0), (2, 0), expected 0, but computed 1
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB on inputs (0, 0), (2, 0), expected 0, but computed 1
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB on inputs (0, 0), (2, 0), expected 0, but computed 1
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB on inputs (0, 0), (2, 0), expected 0, but computed 1
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB on inputs (1, 0), (2, 0), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 1104 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB on inputs (0, 0), (2, 0), expected 0, but computed 1
4 Halted 0 ms 0 KB -