| Task: | Hypyt |
| Sender: | False_Void1 |
| Submission time: | 2025-10-30 20:13:48 +0200 |
| Language: | C++ (C++11) |
| Status: | COMPILE ERROR |
Compiler report
input/code.cpp: In function 'long long int bfs(long long int, long long int, long long int, long long int, std::vector<std::vector<char> >&, std::vector<std::unordered_set<int> >&, std::vector<std::unordered_set<int> >&)':
input/code.cpp:33:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
33 | auto [cy, cx] = q.front();
| ^
input/code.cpp:65:14: error: expected '}' at end of input
65 | }
| ^
input/code.cpp:59:9: note: to match this '{'
59 | {
| ^
input/code.cpp:65:14: error: expected '}' at end of input
65 | }
| ^
input/code.cpp:32:5: note: to match this '{'
32 | {
| ^
input/code.cpp:65:14: error: expected '}' at end of input
65 | }
| ^
input/code.cpp:21:1: note: to match this '{'
21 | {
| ^
input/code.cpp:65:14: warning: control reaches end of non-void function [-Wreturn...Code
#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
#define fastio \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define ll long long
#define pb push_back
#define all(v) v.begin(), v.end()
#define sz(x) (int)(x).size()
const int MOD = 1e9 + 7;
const ll INF = 1e18;
ll y;
ll x;
ll bfs(ll y1, ll x1, ll y2, ll x2, vector<vector<char> > &grid, vector<unordered_set<int> > &unvisited_x, vector<unordered_set<int> > &unvisited_y)
{
queue<pair<int, int> > q;
q.push(make_pair(y2, x2));
unvisited_x[x2].erase(y2);
unvisited_y[y2].erase(x2);
vector<vector<int> > dist(y + 1, vector<int>(x + 1, -1));
dist[y2][x2] = 0;
while (!q.empty())
{
auto [cy, cx] = q.front();
q.pop();
if (cy == y1 && cx == x1)
{
return dist[cy][cx];
}
vector<int> to_remove_y;
for (ll y_test : unvisited_x[cx])
{
if (grid[y_test][cx] == '.' && dist[y_test][cx] == -1)
{
dist[y_test][cx] = dist[cy][cx] + 1;
q.push(make_pair(y_test, cx));
to_remove_y.push_back(y_test);
if (grid[y_test][cx] == '#') {
to_remove_y.push_back(y_test);
}
}
}
for (ll t : to_remove_y)
unvisited_x[cx].erase(t);
vector<int> to_remove_x;
for (ll x_test : unvisited_y[cy])
{
if (grid[cy][x_test] == '.' && dist[cy][x_test] == -1)
{
dist[cy][x_test] = dist[cy][cx] + 1;
q.push(make_pair(cy, x_test));
to_remove_x.push_back(x_test);
}
