记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:12:22: error: conflicting declaration 'std::vector<std::vector<int> > res'
  vector<vector<int>> res;
                      ^~~
foo.cc:10:14: note: previous declaration as 'int res'
  int i,x,n,y,res,ans;
              ^~~
foo.cc:19:12: error: invalid initialization of reference of type 'std::vector<std::vector<int> >&' from expression of type 'int'
   Fight(res);
            ^
foo.cc:7:6: note: in passing argument 1 of 'void Fight(std::vector<std::vector<int> >&)'
 void Fight(vector<vector<int>>& res);
      ^~~~~
foo.cc:20:9: error: request for member 'size' in 'res', which is of non-class type 'int'
   y=res.size();
         ^~~~
foo.cc:22:13: error: invalid types 'int[int]' for array subscript
  cout<<res[1][0]<<" "<<res[1][1];
             ^
foo.cc:22:29: error: invalid types 'int[int]' for array subscript
  cout<<res[1][0]<<" "<<res[1][1];
                             ^
foo.cc:10:18: warning: unused variable 'ans' [-Wunused-variable]
  int i,x,n,y,res,ans;
                  ^~~
foo.cc: In function 'void Fight(std::vector<std::vector<int> >&)':
foo.cc:28:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(i=0;i!=res.size();i++)
          ~^~~~~~~~~~~~
foo.cc:30:10: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> > >::value_type {aka std::vector<int>}' to 'int' in assignment
   x=res[i]; y=res[i+1];
          ^
foo.cc:30:22: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> > >::value_type {aka std::vector<int>}' to 'int' in assignment
   x=res[i]; y=res[i+1];
                      ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1297 D. Jabberwocky
语言
C++
递交时间
2021-11-21 15:07:27
评测时间
2021-11-21 15:07:27
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes