Language: C++

#include <vector>
#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#include <set>
#include <queue>
#include <cstdio>
#include <utility>
#include <bitset>
#include <complex>
#include <stack>
#include <tuple>

using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef tuple<ll,ll,ll> T;
const ll INF = 1e7;
int main(){
	int N;
	cin >> N;
	vector<string> area(N);
	for(int i=0;i<N;i++)
		cin >> area[i];
	vector<int> todo;
	for(int x=0;x<N;x++){
		bool flag=false;
		for(int y=0;y<N;y++){
			if(area[y][x]=='.')
				flag=true;
		}
		if(flag)
			todo.push_back(x);
	}
	ll ans=INF;
	for(int base=0;base<N;base++){
		int cost=INF;
		bool flag=true;
		for(int x=0;x<N;x++)
			if(area[base][x]=='.')
				flag=false;
		if(flag)
			cost=0;
		else{
			bool exist=false;
			for(int y=0;y<N;y++){
				if(area[y][base]=='#')
					exist=true;
			}
			if(exist){
				cost=0;
				for(int x=0;x<N;x++)
					if(area[base][x]=='.')
						cost++;
			}
		}
		ans=min(ans,(ll)cost+todo.size());
	}
	if(ans==INF)
		cout << -1 << endl;
	else
		cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:24: error: no matching function for call to 'min(ll&, long long unsigned int)'
   58 |                 ans=min(ans,(ll)cost+todo.size());
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:58:24: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   58 |                 ans=min(ans,(ll)cost+todo.size());
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:58:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   58 |                 ans=min(ans,(ll)cost+todo.size());
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~