QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#323764#4829. Mark on a Graphhotboy2703Compile Error//C++14875b2024-02-10 13:18:092024-02-10 13:18:09

Judging History

你现在查看的是最新测评结果

  • [2024-02-10 13:18:09]
  • 评测
  • [2024-02-10 13:18:09]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define pll pair <ll,ll>
#define fi first
#define se second
#define sz(a) (ll((a).size()))
#define BIT(mask,i) (((mask) >> (i))&1LL)
#define MASK(i) (1LL << (i))
ll n,m;
vector <ll> g[1010];
int main(){
    ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
    cin>>n>>m;
    for (ll i = 1;i <= m;i ++){
        ll u,v;
        cin>>u>>v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    double average = double(m*2)/n;
    if (sz(g[1])>max(0,llround(average-3))){
        cout<<"mark"<<'\n';
        if (sz(g[1])>=5)g[1].resize(5);
        cout<<sz(g[1])<<'\n';
        for (auto x:g[1]){
            cout<<1<<' '<<x<<'\n';
        }
    }
    else{
        cout<<"ok"<<'\n';
    }
}


详细

answer.code: In function ‘int main()’:
answer.code:24:21: error: no matching function for call to ‘max(int, long long int)’
   24 |     if (sz(g[1])>max(0,llround(average-3))){
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/bits/char_traits.h:39,
                 from /usr/include/c++/11/ios:40,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from answer.code:1:
/usr/include/c++/11/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++/11/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
answer.code:24:21: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘long long int’)
   24 |     if (sz(g[1])>max(0,llround(average-3))){
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/bits/char_traits.h:39,
                 from /usr/include/c++/11/ios:40,
                 from /usr/include/c++/11/istream:38,
                 from /usr/include/c++/11/sstream:38,
                 from /usr/include/c++/11/complex:45,
                 from /usr/include/c++/11/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:54,
                 from answer.code:1:
/usr/include/c++/11/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++/11/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
answer.code:24:21: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘long long int’)
   24 |     if (sz(g[1])>max(0,llround(average-3))){
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_algo.h:3461:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)’
 3461 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/11/bits/stl_algo.h:3461:5: note:   template argument deduction/substitution failed:
answer.code:24:21: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
   24 |     if (sz(g[1])>max(0,llround(average-3))){
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from answer.code:1:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)’
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/11/bits/stl_algo.h:3467:5: note:   template argument deduction/substitution failed:
answer.code:24:21: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
   24 |     if (sz(g[1])>max(0,llround(average-3))){
      |                  ~~~^~~~~~~~~~~~~~~~~~~~~~