Submission #1093781

# Submission time Handle Problem Language Result Execution time Memory
1093781 2024-09-27T12:30:58 Z Abito Maze (JOI23_ho_t3) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define ep insert
#define endl '\n'
#define elif else if
#define pow pwr
#define sqrt sqrtt
#define int long long
#define ll long long
typedef unsigned long long ull;
using namespace std;
const int N=400,M=2e5;
int n,m,k,sx,sy,ex,ey,mvx[]={1,0,-1,0},mvy[]={0,1,0,-1};
vector<vector<int>> dis,p;
vector<vector<bool>> vis;
vector<vector<char>> a;
bool ok(int x,int y){
	return x>=1 && x<=n && y>=1 && y<=m && a[x][y]=='.'; 
}
void bfs1(){
	deque<pair<int,int>> dq;
	dq.push_front({sx,sy});
	dis[sx][sy]=0;
	while (!dq.empty()){
		int x=dq.front().F,y=dq.front().S;
		dq.pop_front();
		if (vis[x][y]) continue;
		//cout<<x<<' '<<y<<' '<<dis[x][y]<<endl;
		vis[x][y]=1;
		for (int i=0;i<4;i++){
			int nx=mvx[i]+x,ny=mvy[i]+y;
			if (!ok(nx,ny)) continue;
			if (dis[nx][ny]>dis[x][y]){
				dis[nx][ny]=dis[x][y];
				dq.push_front({nx,ny});
			}
		}
		for (int i=max(1,x-k);i<=min(n,x+k);i++){
			for (int j=max(1,y-k);j<=min(m,y+k);j++){
				if (i==x-k && j==y-k) continue;
				if (i==x-k && j==y+k) continue;
				if (i==x+k && j==y-k) continue;
				if (i==x+k && j==y+k) continue;
				if (dis[i][j]>dis[x][y]+1){
					dis[i][j]=dis[x][y]+1;
					dq.push_back({i,j});
				}
			}
		}
	}
	return;
}
void bfs2(){
	vector<pair<int,int>> q;
	dis[sx][sy]=0;
	vis[sx][sy]=1;
	q.pb({sx,sy});
	for (int t=0;t<INT_MAX;t++){
		for (int i=0;i<q.size();i++){
			int x=q[i].F,y=q[i].S;
			dis[x][y]=t;
			for (int j=0;j<4;j++){
				int nx=x+mvx[j],ny=y+mvy[j];
				if (vis[nx][ny] || !ok(nx,ny)) continue;
				dis[nx][ny]=t;
				vis[nx][ny]=1;
				q.pb({nx,ny});
			}
		}
		//for (auto u:q) cout<<u.F<<' '<<u.S<<"	";
		//cout<<endl;
		if (vis[ex][ey]) break;
		for (int i=0;i<=n+5;i++) for (int j=0;j<=m+5;j++) p[i][j]=0;
		for (int i=0;i<q.size();i++){
			int x=q[i].F,y=q[i].S;
			p[max(1,x-k)][max(1,y-k)]++;
			p[max(1,x-k)][min(m,y+k)+1]--;
			p[min(n,x+k)+1][max(1,y-k)]--;
			p[min(n,x+k)+1][min(m,y+k)+1]--;
			if (x-k>=1 && y-k>=1){
				p[x-k][y-k]--;
				p[x-k+1][y-k]++;
				p[x-k][y-k+1]++;
				p[x-k+1][y-k+1]--;
			}
			if (x-k>=1 && y+k<=m){
				p[x-k][y+k]--;
				p[x-k+1][y+k]++;
				p[x-k][y+k+1]++;
				p[x-k+1][y+k+1]--;
			}
			if (x+k<=n && y-k>=1){
				p[x+k][y-k]--;
				p[x+k+1][y-k]++;
				p[x+k][y-k+1]++;
				p[x+k+1][y-k+1]--;
			}
			if (x+k<=n && y+k<=m){
				p[x+k][y+k]--;
				p[x+k+1][y+k]++;
				p[x+k][y+k+1]++;
				p[x+k+1][y+k+1]--;
			}
		}
		for (int i=1;i<=n;i++){
			for (int j=1;j<=m;j++){
				p[i][j]+=p[i-1][j]+p[i][j-1]-p[i-1][j-1];
				if (p[i][j]>0 && !vis[i][j]) q.pb({i,j}),vis[i][j]=1;
				//cout<<p[i][j]<<' ';
			}//cout<<endl;
		}//cout<<endl;
	}
}
int32_t main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	cin>>n>>m>>k>>sx>>sy>>ex>>ey;
	for (int i=0;i<=n+5;i++){
		p.pb({});dis.pb({});vis.pb({});a.pb({});
		for (int j=0;j<=m+5;j++){
			p[i].pb(0);dis[i].pb(INT_MAX);vis[i].pb(0);a[i].pb('#');
		}
	}
	for (int i=1;i<=n;i++) for (int j=1;j<=m;j++) cin>>a[i][j];
	if ((2*k+1)*(2*k+1)<=N) bfs1();
	else bfs2();
	cout<<dis[ex][ey]<<endl;
	return 0;
}

Compilation message

Main.cpp: In function 'void bfs1()':
Main.cpp:42:23: error: no matching function for call to 'max(int, long long int)'
   42 |   for (int i=max(1,x-k);i<=min(n,x+k);i++){
      |                       ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
Main.cpp:42:23: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   42 |   for (int i=max(1,x-k);i<=min(n,x+k);i++){
      |                       ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
Main.cpp:42:23: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   42 |   for (int i=max(1,x-k);i<=min(n,x+k);i++){
      |                       ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
Main.cpp:42:23: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   42 |   for (int i=max(1,x-k);i<=min(n,x+k);i++){
      |                       ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
Main.cpp:42:23: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   42 |   for (int i=max(1,x-k);i<=min(n,x+k);i++){
      |                       ^
Main.cpp:43:24: error: no matching function for call to 'max(int, long long int)'
   43 |    for (int j=max(1,y-k);j<=min(m,y+k);j++){
      |                        ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
Main.cpp:43:24: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   43 |    for (int j=max(1,y-k);j<=min(m,y+k);j++){
      |                        ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
Main.cpp:43:24: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   43 |    for (int j=max(1,y-k);j<=min(m,y+k);j++){
      |                        ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
Main.cpp:43:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   43 |    for (int j=max(1,y-k);j<=min(m,y+k);j++){
      |                        ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
Main.cpp:43:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   43 |    for (int j=max(1,y-k);j<=min(m,y+k);j++){
      |                        ^
Main.cpp: In function 'void bfs2()':
Main.cpp:63:17: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   63 |   for (int i=0;i<q.size();i++){
      |                ~^~~~~~~~~
Main.cpp:78:17: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   78 |   for (int i=0;i<q.size();i++){
      |                ~^~~~~~~~~
Main.cpp:80:15: error: no matching function for call to 'max(int, long long int)'
   80 |    p[max(1,x-k)][max(1,y-k)]++;
      |               ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
Main.cpp:80:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   80 |    p[max(1,x-k)][max(1,y-k)]++;
      |               ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
Main.cpp:80:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   80 |    p[max(1,x-k)][max(1,y-k)]++;
      |               ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
Main.cpp:80:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   80 |    p[max(1,x-k)][max(1,y-k)]++;
      |               ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
Main.cpp:80:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   80 |    p[max(1,x-k)][max(1,y-k)]++;
      |               ^
Main.cpp:80:27: error: no matching function for call to 'max(int, long long int)'
   80 |    p[max(1,x-k)][max(1,y-k)]++;
      |                           ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
Main.cpp:80:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   80 |    p[max(1,x-k)][max(1,y-k)]++;
      |                           ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
Main.cpp:80:27: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   80 |    p[max(1,x-k)][max(1,y-k)]++;
      |                           ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
Main.cpp:80:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   80 |    p[max(1,x-k)][max(1,y-k)]++;
      |                           ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
Main.cpp:80:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   80 |    p[max(1,x-k)][max(1,y-k)]++;
      |                           ^
Main.cpp:81:15: error: no matching function for call to 'max(int, long long int)'
   81 |    p[max(1,x-k)][min(m,y+k)+1]--;
      |               ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
Main.cpp:81:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   81 |    p[max(1,x-k)][min(m,y+k)+1]--;
      |               ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
Main.cpp:81:15: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   81 |    p[max(1,x-k)][min(m,y+k)+1]--;
      |               ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
Main.cpp:81:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   81 |    p[max(1,x-k)][min(m,y+k)+1]--;
      |               ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
Main.cpp:81:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   81 |    p[max(1,x-k)][min(m,y+k)+1]--;
      |               ^
Main.cpp:82:29: error: no matching function for call to 'max(int, long long int)'
   82 |    p[min(n,x+k)+1][max(1,y-k)]--;
      |                             ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:254:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
Main.cpp:82:29: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   82 |    p[min(n,x+k)+1][max(1,y-k)]--;
      |                             ^
In file included from /usr/include/c++/10/bits/specfun.h:45,
                 from /usr/include/c++/10/cmath:1927,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:300:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
Main.cpp:82:29: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   82 |    p[min(n,x+k)+1][max(1,y-k)]--;
      |                             ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3480:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)'
 3480 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3480:5: note:   template argument deduction/substitution failed:
Main.cpp:82:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   82 |    p[min(n,x+k)+1][max(1,y-k)]--;
      |                             ^
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from Main.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)'
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/10/bits/stl_algo.h:3486:5: note:   template argument deduction/substitution failed:
Main.cpp:82:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   82 |    p[min(n,x+k)+1][max(1,y-k)]--;
      |                             ^