/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int sum(int, int)':
/in/foo.cc:19:40: error: reference to 'max' is ambiguous
 if((x==1&&y==3)||(x==3&&y==1)||pre+beh>max)return -1;
                                        ^~~
/in/foo.cc:5:5: note: candidates are: int max
 int max;
     ^~~
In file included from /usr/include/c++/6/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:65,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_algo.h:3465:5: note:                 template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
/usr/include/c++/6/bits/stl_algo.h:3459:5: note:                 template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)
     max(initializer_list<_Tp> __l)
     ^~~
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_algobase.h:265:5: note:                 template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
/usr/include/c++/6/bits/stl_algobase.h:219:5: note:                 template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:37:16: error: reference to 'max' is ambiguous
 scanf("%d %d",&max,&tishu);
                ^~~
/in/foo.cc:5:5: note: candidates are: int max
 int max;
     ^~~
In file included from /usr/include/c++/6/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:65,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_algo.h:3465:5: note:                 template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare)
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
/usr/include/c++/6/bits/stl_algo.h:3459:5: note:                 template<class _Tp> _Tp std::max(std::initializer_list<_Tp>)
     max(initializer_list<_Tp> __l)
     ^~~
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
                 from /usr/include/c++/6/ios:40,
                 from /usr/include/c++/6/istream:38,
                 from /usr/include/c++/6/sstream:38,
                 from /usr/include/c++/6/complex:45,
                 from /usr/include/c++/6/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/6/bits/stdc++.h:52,
                 from /in/foo.cc:1:
/usr/include/c++/6/bits/stl_algobase.h:265:5: note:                 template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare)
     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
     ^~~
/usr/include/c++/6/bits/stl_algobase.h:219:5: note:                 template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&)
     max(const _Tp& __a, const _Tp& __b)
     ^~~
/in/foo.cc:41:9: error: 'imax' was not declared in this scope
 for(i=0;imax)
         ^~~~
/in/foo.cc:41:13: error: expected ';' before ')' token
 for(i=0;imax)
             ^
/in/foo.cc:53:6: error: expected primary-expression before ':' token
 for(;:wink:
      ^
/in/foo.cc:53:6: error: expected ';' before ':' token
/in/foo.cc:53:6: error: expected primary-expression before ':' token
/in/foo.cc:53:6: error: expected ')' before ':' token
/in/foo.cc:53:6: error: expected primary-expression before ':' token
/in/foo.cc:93:1: error: 'else' without a previous 'if'
 else break;
 ^~~~
/in/foo.cc:93:6: error: break statement not within loop or switch
 else break;
      ^~~~~
/in/foo.cc: At global scope:
/in/foo.cc:99:7: error: expected constructor, destructor, or type conversion before '(' token
 printf("%d",(int)(1000.0/tishu*right));
       ^
/in/foo.cc:101:1: error: expected unqualified-id before 'return'
 return 0;
 ^~~~~~
/in/foo.cc:103:1: error: expected declaration before '}' token
 }
 ^

信息

递交者
类型
递交
题目
P1300 儿子游戏机
语言
C++
递交时间
2021-12-14 20:57:01
评测时间
2021-12-14 20:57:01
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes