Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define PI 3.14159265359
#define INF 1000100100
typedef long long ll;
using namespace std;

vector<vector<int>> friends;
vector<vector<int>> brock;
vector<int> check;

int bfs(int root,int now){
    int ans=0; int l=0;
    while(l<friends[root].size()){
        int next=friends[root][l];
        if(!check[root]){
            check[root]=now;
            ans++;
        }
        if(!check[next]) ans+=bfs(next,now);
        l++;
    }
    return ans;
}


int main(){
    int n,m,k; cin >> n >> m >> k;
    friends.resize(n);
    brock.resize(n);
    check=vector<int>(n,0);
    rep(i,m){
        int a,b; cin >> a >> b;
        a--; b--;
        friends[a].push_back(b);
        friends[b].push_back(a);
    }
    rep(i,k){
        int c,d; cin >> c >> d;
        c--; d--;
        brock[c].push_back(d);
        brock[d].push_back(c);
    }
    
    vector<int> ans(n+1,0);

    int nownow=1;

    rep(i,n){
        if(!check[i]){
            ans[nownow]=bfs(i,nownow);
            nownow++;
        }
    }

    vector<int> br(n,0);

    rep(i,n){
        rep(j,brock[i].size()){
            if(check[brock[i][j]]==check[i]) br[i]++;
        }
    }

    rep(i,n){
        printf("%d ",max(0,ans[check[i]]-friends[i].size()-br[i]-1));
    }
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:25: error: no matching function for call to 'max(int, std::vector<int>::size_type)'
   65 |         printf("%d ",max(0,ans[check[i]]-friends[i].size()-br[i]-1));
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:65:25: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::vector<int>::size_type' {aka 'long unsigned int'})
   65 |         printf("%d ",max(0,ans[check[i]]-friends[i].size()-br[i]-1));
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:65:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   65 |         printf("%d ",max(0,ans[check[i]]-friends[i].size()-br[i]-1));
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~