Submission #837445

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8374452023-08-25 10:57:08LiudasSoccer (JOI17_soccer)C++17
100 / 100
385 ms27116 KiB
#include <bits/stdc++.h>
#define int long long
using namespace std;
struct node{
int type;
int val;
int x, y;
bool operator<(const node & a)const{
return val > a.val;
}
};
signed main(){
int X, Y, A, B, C, N;
cin >> X >> Y >> A >> B >> C >> N;
vector<pair<int,int>> players(N);
vector<vector<int>> pos(X + 10, vector<int>(Y + 10, 1e9));
queue<array<int, 3>> populate;
for(int i = 0; i < N; i ++){
cin >> players[i].first >> players[i].second;
populate.push({players[i].first, players[i].second, 0});
}
while(!populate.empty()){
int x = populate.front()[0], y = populate.front()[1], c = populate.front()[2];
populate.pop();
if(pos[x][y] <= c)continue;
if(x > 0)populate.push({x - 1, y , c+ 1});
if(y > 0)populate.push({x, y-1, c+1});
if(x < X)populate.push({x + 1, y, c + 1});
if(y < Y)populate.push({x, y + 1, c + 1});
pos[x][y] = c;
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...