Submission #910921

# Submission time Handle Problem Language Result Execution time Memory
910921 2024-01-18T09:39:18 Z oblantis Tracks in the Snow (BOI13_tracks) C++17
Compilation error
0 ms 0 KB
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#pragma GCC optimize("O3,unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define all(v) v.begin(), v.end()
#define pb push_back
#define ss second
#define ff first
#define vt vector
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef pair<int, int> pii;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int inf = 1e9;
const int mod = 1e9+7;
const int maxn = 4e3 + 2;
char a[maxn][maxn];
bool was[maxn][maxn];
queue<pii> q;
void go(int x, int y, char s, int cnt){
	if(a[x][y] != s)return;
	q.push({x, y});
	was[x][y] = 1;
	if(!was[x - 1][y])go(x - 1, y, s);
	if(!was[x + 1][y])go(x + 1, y, s);
	if(!was[x][y - 1])go(x, y - 1, s);
	if(!was[x][y + 1])go(x, y + 1, s);
}
void solve() {
	int n, m;
	cin >> n >> m;
	for(int i = 1; i <= n; i++){
		was[i][0] = was[i][m + 1] = 1;
		for(int j = 1; j <= m; j++){
			cin >> a[i][j];
			if(a[i][j] == '.')was[i][j] = 1;
		}
	}
	for(int i = 1; i <= m; i++)was[0][i] = was[n + 1][i] = 1;
	int ans = 0;
	char s = a[n][m];
	go(n, m, s);
	cout << ans;
}
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int times = 1;
	//cin >> times;
	for(int i = 1; i <= times; i++) {
		solve();
	}
	return 0;
}

Compilation message

tracks.cpp: In function 'void go(int, int, char, int)':
tracks.cpp:26:34: error: too few arguments to function 'void go(int, int, char, int)'
   26 |  if(!was[x - 1][y])go(x - 1, y, s);
      |                                  ^
tracks.cpp:22:6: note: declared here
   22 | void go(int x, int y, char s, int cnt){
      |      ^~
tracks.cpp:27:34: error: too few arguments to function 'void go(int, int, char, int)'
   27 |  if(!was[x + 1][y])go(x + 1, y, s);
      |                                  ^
tracks.cpp:22:6: note: declared here
   22 | void go(int x, int y, char s, int cnt){
      |      ^~
tracks.cpp:28:34: error: too few arguments to function 'void go(int, int, char, int)'
   28 |  if(!was[x][y - 1])go(x, y - 1, s);
      |                                  ^
tracks.cpp:22:6: note: declared here
   22 | void go(int x, int y, char s, int cnt){
      |      ^~
tracks.cpp:29:34: error: too few arguments to function 'void go(int, int, char, int)'
   29 |  if(!was[x][y + 1])go(x, y + 1, s);
      |                                  ^
tracks.cpp:22:6: note: declared here
   22 | void go(int x, int y, char s, int cnt){
      |      ^~
tracks.cpp: In function 'void solve()':
tracks.cpp:44:12: error: too few arguments to function 'void go(int, int, char, int)'
   44 |  go(n, m, s);
      |            ^
tracks.cpp:22:6: note: declared here
   22 | void go(int x, int y, char s, int cnt){
      |      ^~