/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'void f(std::__cxx11::string)':
/in/foo.cc:27:14: error: call of overloaded 'stoi(std::__cxx11::string&)' is ambiguous
  int t=stoi(s);
              ^
/in/foo.cc:17:5: note: candidate: int stoi(std::__cxx11::string)
 int stoi(string s){
     ^~~~
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:3:
/usr/include/c++/6/bits/basic_string.h:5427:3: note: candidate: int std::__cxx11::stoi(const string&, std::size_t*, int)
   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
   ^~~~
/in/foo.cc:34:15: error: call of overloaded 'stoi(std::__cxx11::string&)' is ambiguous
   if(stoi(temp)<=n)
               ^
/in/foo.cc:17:5: note: candidate: int stoi(std::__cxx11::string)
 int stoi(string s){
     ^~~~
In file included from /usr/include/c++/6/string:52:0,
                 from /usr/include/c++/6/bits/locale_classes.h:40,
                 from /usr/include/c++/6/bits/ios_base.h:41,
                 from /usr/include/c++/6/ios:42,
                 from /usr/include/c++/6/ostream:38,
                 from /usr/include/c++/6/iostream:39,
                 from /in/foo.cc:3:
/usr/include/c++/6/bits/basic_string.h:5427:3: note: candidate: int std::__cxx11::stoi(const string&, std::size_t*, int)
   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
   ^~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:47:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<v.size();i++)
              ~^~~~~~~~~

信息

递交者
类型
递交
题目
P1042 捕风捉影
语言
C++
递交时间
2019-02-24 21:29:35
评测时间
2019-02-24 21:29:35
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes