Language: C++

#include <bits/stdc++.h>
#include <limits>
#include <math.h>
#include <cmath>
#include <cctype>
#include <cstdio>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pll = pair<ll, ll> ;
using vs = vector<string>;
using vb = vector<bool>;
using vll = vector<long long>;
using vvll = vector<vector<long long >>;
#define PI  3.1415926535
#define rep(i, k, n) for(ll i = k; i < n; i++)

vvll friendd;//友達関係
vvll block;//ブロック関係

ll friend_potential(ll x,const vvll &friendd, const vvll &block){
  
  ll fxs = friendd[x].size();
  
  //まずはtreeをつくる
  //xの友達をキューとセットに追加
  queue<ll> que; set<ll> S;
  rep(i, 0, fxs){
    que.push(friendd[x][i]);
    S.insert(friendd[x][i]);
  }
  
  //友達の友達をたどっていく
  while(que.size()){
    //先頭のキューを取り出す
    ll p = que.front();
    que.pop();
    //pの友達がセットになければキューとセットに追加
    ll fps = friendd[p].size();
    rep(i, 0, fps){
      if(!S.count(friendd[p][i])){
        que.push(friendd[p][i]);
    	S.insert(friendd[p][i]);
      }
    }
  }
  
  //友達候補はtreeから友達関係とブロック関係を引いたもの
  ll fr_pot = S.size() - friendd[x].size();//友達関係をひく
  //ブロック関係をひく
  ll bxs = block[x].size();
  rep(i, 0, bxs){
    if(S.count(block[x][i])){
      fr_pot--;
    }
  }
  
  return fr_pot;
}
  
int main(){
  ll n, m, k; cin >> n >> m >> k;
  friendd = vvll (n+1,vll(0));
  block = vvll (n+1,vll(0));
  
  rep(i, 0, m){
    ll a, b; cin >> a >> b;
    friendd[a].emplace_back(b);
    friendd[b].emplace_back(a);
  }
  
  rep(i, 0, k){
    ll a, b; cin >> a >> b;
    block[a].emplace_back(b);
    block[b].emplace_back(a);
  }
  
  rep(i, 1, n+1){
    cout << max(friend_potential(i, friendd, block)-1,0) << endl;
  }
}
  
  
  
    
    
    
    
    
  
    
    
    




Compiler output:
a.cc: In function 'int main()':
a.cc:79:16: error: no matching function for call to 'max(ll, int)'
   79 |     cout << max(friend_potential(i, friendd, block)-1,0) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:79:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   79 |     cout << max(friend_potential(i, friendd, block)-1,0) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:79:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   79 |     cout << max(friend_potential(i, friendd, block)-1,0) << endl;
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~