제출 #1178641

#제출 시각아이디문제언어결과실행 시간메모리
1178641newbie__1코알라 (APIO17_koala)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define ll long long using namespace std; ll minValue(ll n,ll w){ vector<ll>c(n,0),r(n,0); c[0]=1; lround(c,r); for(ll i=0;i<n;i++){ if(r[i]==0){ return i; } } return 0; } ll maxValue(ll n,ll w){ // ind mx val return n; } ll greaterValue(ll n,ll w){ // ind 0 || 1 return n; } void allValues(ll n,ll w,vector<ll>& p){ return; }

컴파일 시 표준 에러 (stderr) 메시지

koala.cpp: In function 'long long int minValue(long long int, long long int)':
koala.cpp:8:11: error: no matching function for call to 'lround(std::vector<long long int>&, std::vector<long long int>&)'
    8 |     lround(c,r);
      |     ~~~~~~^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from koala.cpp:1:
/usr/include/c++/11/cmath:1636:5: note: candidate: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, long int>::__type std::lround(_Tp)'
 1636 |     lround(_Tp __x)
      |     ^~~~~~
/usr/include/c++/11/cmath:1636:5: note:   template argument deduction/substitution failed:
koala.cpp:8:11: note:   candidate expects 1 argument, 2 provided
    8 |     lround(c,r);
      |     ~~~~~~^~~~~
In file included from /usr/include/features.h:486,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:33,
                 from koala.cpp:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:323:1: note: candidate: 'long int lround(double)'
  323 | __MATHDECL (long int,lround,, (_Mdouble_ __x));
      | ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:323:1: note:   candidate expects 1 argument, 2 provided
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:41,
                 from koala.cpp:1:
/usr/include/c++/11/cmath:1628:3: note: candidate: 'constexpr long int std::lround(long double)'
 1628 |   lround(long double __x)
      |   ^~~~~~
/usr/include/c++/11/cmath:1628:3: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/11/cmath:1624:3: note: candidate: 'constexpr long int std::lround(float)'
 1624 |   lround(float __x)
      |   ^~~~~~
/usr/include/c++/11/cmath:1624:3: note:   candidate expects 1 argument, 2 provided