답안 #1025380

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1025380 2024-07-17T01:09:05 Z HD1 Vision Program (IOI19_vision) C++14
0 / 100
2 ms 984 KB
#include "vision.h"
#include<bits/stdc++.h>
#define sz(x) ll(x.size())
#define all(x) x.begin(),x.end()
#define pb push_back
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
const ll MAX=1e6;
ii mobs[10]={{1,1},{-1,-1},{1,-1},{-1,1},{0,1},{1,0},{-1, 0},{0, -1}};
int n, m, k;
int n_consultas=0;
vector<int> s;
bool valid(int x, int y, int i, int j){
	return x>=0 && x<n && y>=0 && y<m && (abs(x-i)+abs(y-j)==k);
}
void mover(int a, int b, int i, int j){
	vector<int>q;
	q.pb(i*n+j);
	for(int w=0; w<8; w++){
		int x =i+a*mobs[w].ff;
		int y =j+b*mobs[w].ss;
		if(valid(x,y,i,j)){
			q.pb(x*n+y);
			//cout<<i<<' '<<j<<'/'<<x<<' '<<y<<'\n';
			add_and(q);
			n_consultas++;
			q.pop_back();
		}
	}
}
void looks(int a, int b){
	for(int x=0; x<=k; x++){
		mover(x, k-x, a, b);
	}
}
void construct_network(int H, int W, int K){
	n=H;
	m=W;
	k=K;
	//cout<<"avocado"<<'\n';
	for(int i=0; i<H; i++){
		for(int j=0; j<W; j++){
			looks(i,j);
		}
	}
	for(int i=0; i<n_consultas; i++){
		s.pb(i+n*m);
	}
	add_or(s);
	return;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB WA in grader: Invalid index
4 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 1 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB WA in grader: Invalid index
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 1 ms 980 KB WA in grader: Too many instructions
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 984 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB WA in grader: Invalid index
4 Halted 0 ms 0 KB -