Submission #3421520


Source Code Expand

#include<iostream>
#include<vector>
using namespace std;

int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};


void solve(vector<vector<char>> A,int x,int y){
  if(A[x][y]=='x'){
    return;
  }
  
  A[x][y]='o';
  for(int i=0;i<4;i++){
    int rx=x+dx[i];
    int ry =y+dy[i];
    if(rx>=0&&rx<10&&ry>=0&&ry<10){
      solve(A,rx,ry);
    }
  }
return;
}
 







int main(){
  vector<vector<char>> A[10][10];
  for(int i=0;i<10;i++){
    for(int i=0;i<10;i++){
      cin >> A[i][j];
    }
  }
  int ans=0;
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      vector<vector<char>> B(A);
      int count = 0;
      for(int ii=0;i<10;i++){
        for(int jj=0;jj<10;jj++){
          if(A[ii][jj]=='x'){
            count++;
          }
        }
      }
      if(cout==100){
        ans++;
      }
    }
  }
  if(ans){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
  return 0;
}
      
       

Submission Info

Submission Time
Task B - 埋め立て
User Yasagure
Language C++14 (GCC 5.4.1)
Score 0
Code Size 972 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:36:19: error: ‘j’ was not declared in this scope
       cin >> A[i][j];
                   ^
./Main.cpp:42:31: error: no matching function for call to ‘std::vector<std::vector<char> >::vector(std::vector<std::vector<char> > [10][10])’
       vector<vector<char>> B(A);
                               ^
In file included from /usr/include/c++/5/vector:64:0,
                 from ./Main.cpp:2:
/usr/include/c++/5/bits/stl_vector.h:401:9: note: candidate: template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&)
         vector(_InputIterator __first, _InputIterator __last,
         ^
/usr/include/c++/5/bits/stl_vector.h:401:9: note:   template argument deduction/substitution failed:
./Main.cpp:42:31: note:   candidate expects 3 arguments, 1 provided
       vector<vector<char>> B(A);
                               ^
In file included from /usr/include/c++/5/vector:64:0,
                 from ./Main....