Language: C++

#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;




int main(){
    ll h,w;
    cin>>h>>w;
    vector<string> a(h);
    for(int i=0;i<h;i++){
        cin>>a[i];
    }
    vector<string> ans(h,string(w,0));
    for(int i=0;i<h;i++){
        ans[i][0]=1;//blue
        ans[i][w-1]=2;//red
    }
    for(int i=0;i<h;i++){
        for(int t=1;t+1<w;t++){
            ans[i][t]=i&1?1:2;
        }
    }
    for(int i=0;i<h;i++){
        for(int t=0;t<w;t++){
            if(a[i][t]=='#'){ans[i][t]=3;}
        }
    }
    for(int i=0;i<h;i++){
        for(int t=0;t<w;t++){
            cout<<ans[i][t]&1?'#':'.';
        }
        cout<<endl;
    }
    cout<<endl;
    for(int i=0;i<h;i++){
        for(int t=0;t<w;t++){
            cout<<ans[i][t]&2?'#':'.';
        }
        cout<<endl;
    }
    
    
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:28: error: no match for 'operator&' (operand types are 'std::basic_ostream<char>' and 'int')
   62 |             cout<<ans[i][t]&1?'#':'.';
      |                            ^~
      |                             |
      |                             int
a.cc:62:28: note: candidate: 'operator&(int, int)' (built-in)
   62 |             cout<<ans[i][t]&1?'#':'.';
      |             ~~~~~~~~~~~~~~~^~
a.cc:62:28: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
In file included from a.cc:22:
/usr/include/c++/14/bitset:1557:5: note: candidate: 'template<long unsigned int _Nb> std::bitset<_Nb> std::operator&(const bitset<_Nb>&, const bitset<_Nb>&)'
 1557 |     operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
      |     ^~~~~~~~
/usr/include/c++/14/bitset:1557:5: note:   template argument deduction/substitution failed:
a.cc:62:29: note:   'std::basic_ostream<char>' is not derived from 'const std::bitset<_Nb>'
   62 |             cout<<ans[i][t]&1?'#':'.';
      |                             ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
                 from /usr/include/c++/14/string:68,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/iomanip:42,
                 from a.cc:1:
/usr/include/c++/14/cstddef:141:3: note: candidate: 'constexpr std::byte std::operator&(byte, byte)'
  141 |   operator&(byte __l, byte __r) noexcept
      |   ^~~~~~~~
/usr/include/c++/14/cstddef:141:18: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::byte'
  141 |   operator&(byte __l, byte __r) noexcept
      |             ~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:84:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator&(_Ios_Fmtflags, _Ios_Fmtflags)'
   84 |   operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:84:27: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Fmtflags'
   84 |   operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:134:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator&(_Ios_Openmode, _Ios_Openmode)'
  134 |   operator&(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:134:27: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Openmode'
  134 |   operator&(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:181:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator&(_Ios_Iostate, _Ios_Iostate)'
  181 |   operator&(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:181:26: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Iostate'
  181 |   operator&(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~^~~
a.cc:69:28: error: no match for 'operator&' (operand types are 'std::basic_ostream<char>' and 'int')
   69 |             cout<<ans[i][t]&2?'#':'.';
      |                            ^~
      |                             |
      |                             int
a.cc:69:28: note: candidate: 'operator&(int, int)' (built-in)
   69 |             cout<<ans[i][t]&2?'#':'.';
      |             ~~~~~~~~~~~~~~~^~
a.cc:69:28: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'int'
/usr/include/c++/14/bitset:1557:5: note: candidate: 'template<long unsigned int _Nb> std::bitset<_Nb> std::operator&(const bitset<_Nb>&, const bitset<_Nb>&)'
 1557 |     operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y) _GLIBCXX_NOEXCEPT
      |     ^~~~~~~~
/usr/include/c++/14/bitset:1557:5: note:   template argument deduction/substitution failed:
a.cc:69:29: note:   'std::basic_ostream<char>' is not derived from 'const std::bitset<_Nb>'
   69 |             cout<<ans[i][t]&2?'#':'.';
      |                             ^
/usr/include/c++/14/cstddef:141:3: note: candidate: 'constexpr std::byte std::operator&(byte, byte)'
  141 |   operator&(byte __l, byte __r) noexcept
      |   ^~~~~~~~
/usr/include/c++/14/cstddef:141:18: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::byte'
  141 |   operator&(byte __l, byte __r) noexcept
      |             ~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:84:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator&(_Ios_Fmtflags, _Ios_Fmtflags)'
   84 |   operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:84:27: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Fmtflags'
   84 |   operator&(_Ios_Fmtflags __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:134:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator&(_Ios_Openmode, _Ios_Openmode)'
  134 |   operator&(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:134:27: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Openmode'
  134 |   operator&(_Ios_Openmode __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:181:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator&(_Ios_Iostate, _Ios_Iostate)'
  181 |   operator&(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:181:26: note:   no known conversion for argument 1 from 'std::basic_ostream<char>' to 'std::_Ios_Iostate'
  181 |   operator&(_Ios_Iostate __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~^~~