Language: C++

 /*                 .  YO.               vq                            :G       Z:
 *        SqOMBB@B@Br @@r rBE           @B     B@@@@@B@ONX8k    i::::.OB1.:::.u@O.::::i           @B@B@U:@@B@@BPEBu
 *        B@@NB@k.    5@i  uB@E.        BM     1U2uUJvirB@@Z   r@@B@B@@@B@B@B@B@B@@@B@Bi   LB@B@1 BX :@k uLLLvr@BJ:
 *            iB      iBi    7@     .@M8@BGMZZ         @@F            ,B       Pi          v@  Bq @i v@        B@
 *       vuL7r8@S7vJL7N@Z7LLri;72.   F7@Bvvv@@       @BX         @@@B@B@@@@@B@@@B@B@B      7@  @F Bi @q  @B@Bu @B
 *       N@B@G@@@8@BBOMB@G@BMNXG@,     B@   @@      .Bk          .:u;    i@:      Zv       7@  Bk @,;@  ,BY @B B@
 *            r@       @G     5.      ,@v   BZ :::,.r@E .::i,      @B     B@    .@BL       7@  @F B:i@. .@  @M @B
 *            7B: ,vO, @@   iB@:      @B   7@:MB@B@B@@@B@B@BM       @@.    B:  2@q         7@  BS @i 0@  B. @O B@
 *       ,r2EBB@B@B@Bi G@  @BB        B@   @B        @S              :    r@   ..          7B  @F @7  B7 @  @B @B
 *       E@B@UOBr       @B@Bi          L@0PB        .BZ        .@B@B@B@B@B@B@B@B@B@B@B@,   r@  BF @i  @G B@B@B B@
 *            7@,      kB@U    ;r        @@@.       .@Z                GBuL@iBBi           vB@B@q BP:5@7 @u,.  @B
 *            LBi   YB@BrB@    @@       @B:L@Br      BM             .M@B  rB  rB@J         v@. Pi @XZ8r  .     B@
 *        .   G@i B@BM.  ,B@,  @B    iB@B    N, 7r..q@k         ,LB@B8    J@,   i@B@B1r           Br           @@
 *        MB@B@B  ,i       B@B@B,    B@:        @B@B@F         .@BB:      P@i      :OBZ          .@U       B@B@B:
 *                          .ll                                           rB.                     :
                 .::                                                       ,,         .:                    :,         :.
          :LuqL  5B@   :v             77L21F5F5F5F1F5S15Uv7,              :@B         0@U                  .B@        L@P
 B@B@@@B@B@B@@B  L@B   B@B@,          @BB2XSPSPkPXPkPXPF2B@B     .@B@B@B@B@@@B@B@B@B@@@B@B@B@B@B@ :@@@@BBMOB@BGM@B@BME@@@EMB@B@B@r
 ,Yi:  @B2       iB@     2@@@7        B@,                8Bq      vriii:.:0@@:ii::,:::B@B::iiii77 ,E1uJuJJ7GB@7LUk2ULvB@B7LjJjjSq:
       B@7        @B       i7         @B@B@B@B@B@B@B@B@B@B@k          @B  .BZ    u@.   :                   ,@N        7B2
0EqEqX2@B@1N0Z0ZSqB@qX0ZNPUYLSZ8      B@                 NBP          :@B       1@BMX0uj2EEZN15,    8@B@B@@@GGB@7 5@B@BOM@B@B@B.
@B@B@B@@@B@B@B@B@B@B@B@B@B@B@B@B      @B@B@B@B@B@B@B@B@B@B@q      @B@B@B@B@@@u S@B2qOOMOMM@BMB@L              @@7            B@.
       @Bv        @@v       .         B@:                k@v      :i;.,...q5::B@k            @Bi     8@@B@B@B@B@v  BB@B@B@B@@@B.
       B@L   .,7  0B@     SB@S   :5jj7vi::iiiii:..,:iii::;77LY25   B@     @B u@20B@B@B@B@N   @@:     B@       .:   B@        ::
 .:v28P@B@@@B@B@, ,@@   u@B@.    YB@B@ME0OB@B@@@B@BMB@B@BBOBB@B@.  L@@   OBS    B@:    JB@   @B.    v@BLuXP0qXvL: 1@B7ukXE00SYvL
@@@B@B@B@Z.        B@kLB@B:            7Ei      @@;                 @B:  B@     @B     .@O   B@      LO1i   , @B0  ;BX7.  ,..P@B
       @Bu         1B@B5     ::       :@B       B@@@B@B@@@B@B@      7@@ U@u     B@i,::.PB@   @B      .7OBGu   Z@v   rNBOFi   7B8
       B@5      7B@B@B@      B@B     i@B@7      @BN.::i:i:i:ii       17 @B      @B@B@B@MMY   B@          u@OBUMBi      :@BNBYv@F
       @B0  u@B@B@L  kB@;    @@;    0@B.J@@O:   B@i               ,:ii7@B@B@@@u SZ          i@B    LB@@@B@5Y, B@, 5@@@B@GFY: ZBu
 :5rr:5B@J  MBM:      iB@@k:@@@  ,NB@E    k@@B@B@B@qEZMMBM@MBB@Br @B@B@OY77:,      :MSUjuukB@Br    iBvUr.   .8@B  i5::r     YB@
 .B@B@BZ:                0B@B8   @BO         .:i:77uU5uFSkFkFXXq                    B@B@@@GU.         ,@B@B@BM:       B@B@B@B7
          .:7kq  ;@B,   ,                   @B.    i@M                .B@,      N@@       .BO       :,.            .:..
 LB@@@B@B@B@B@@  :B@,  EB@O,                B@i    U@@                 ,q@BX    1@B    ,q@B0:      ,B@B@B@B@B@B@1  @B@B@B@B@B@B@
  kri. M@@        @B:    u@B@J    @B@B@B@B@@@Bi    J@@@B@B@B@B@B   irrvi:u@BjLJ7@B@7YYLB@Bj::rir              @Bj            i@B
       EBO        @@:      :1     iiii:i::,:B@:    uB@.::i:i:iii   @B@qquvrLu1127rrUU5Uvrrv5q@B@.    .,iiiii::B@L   .,:iiiii:E@@
YLLvv7iB@Bi7YLYL7r@@ErLLL7r::iYU            @@i    Y@@             B@k      . .     ...       @B,    B@B@B@B@B@BF   @B@B@B@B@@@B
@@B@B@B@B@@@B@B@B@B@B@B@B@B@B@B@.           B@i    uB@             r7. ,B@MMMBMBMBMBMBMMG@B@  7v    r@M            LB8
       E@O        PBM       .     vB@B@B@@@B@Bi    J@B@B@B@B@@@7       .@B               P@8        @BX.::i:i:     B@2,:::i:i.  .
       Z@M     ;  ;@B     i@@@    ,ULYLJLL77@@i    uB@ivLYLJLJu:       ,B@B@B@B@B@B@B@B@B@B@        BOEOB@B@B@B@q  BZNO@B@B@B@B@@
  ,:i7JB@B@B@B@@u  B@:  :B@Bv               @Bi    J@B                  2J      uB@      :u:         @@r      @BL  7@X:       8BZ
B@B@B@B@B@,i.      kBBi@B@L                 B@i    j@@               uYjvJ2kSk1jM@@u2kFS1uLuJUi      iu@B@O   B@i  .iNB@Bj    B@u
 .     Z@M         :@B@Mi     :  rEXqXXXPS5U@Bi    Y@Bj1XXqkXXN07    B@Bq088OOGk@B@SE8OZZNq5@B@          i7:, @@,       ::i2r @B7
       MB@      ,8B@B@B      kB@ Y@@B@B@BBOGB@i    uB@EMB@B@B@B@j    @Bi        7@B         G@8    ukBB@@@B@P B@  .75BB@@@B@: B@:
       O@B  7u@B@BO, v@@v    B@G            @Bi    J@B               B@Y        uB@    7:,.i@BS   ,B@B1:     .@B  N@@BL       @B.
  5ri:r@B@  k@BL.     ,@B@q:5@B             B@r    1@@               @B7        F@B    @B@B@Or        .i.,,:1@B8       r,:::u@B@
  @B@B@B1               .q@B@B:             @Br    L@B                          5B@                   kB@B@@@5.       r@@@@B@Z;
           ,ijN   B@L   .             B@5                          .:...,:,:,.     ,,:.......                  ... .
 :@B@B@@@B@B@@@i  @B1  j@B@.         .@B      .B@B@B@@@B@B@B@B@B   G@B@B@B@B@B@B  .B@B@B@@@B@B@v    7;L7ri. @@@B@B@@ B@B@B@@@B@B@@
  NLrr:0B@        B@2    YB@@N       UBB       ... .      .@B@Bi              B@             @Br    B@BBB@8 B@   JBE         :B@
       :@B        BBk      .O:   E@B@B@B@B@B@P          .M@BS        ..,:,:,.7@@    ,.:,:::.,B@i    @B  :BS BB   B@           @B
:L77rr:E@@ir7vvvr:B@B:rv7ri:::rJ :7ij@Biir:@BM        :@B@i         v@B@@@B@B@@@   UB@B@B@B@B@BL    B@  i@5 M@  S@v  UB@B@@M  B@
8B@B@B@B@B@B@B@B@B@@@B@B@@@B@B@@L   JBM    @@i        5B@           @B.            @@               @B  ;@F BB  @B   O@L .@B  @B
       7B@        i@B               @@,    @B         L@B          ,B@..,:,,..    :@B..,,:,:.  .    B@  i@5 M@ .B@   NB.  B@  @@
       ;@B     ,,  B@      @@B.    U@B    0BE @B@B@B@B@B@B@B@B@B@  LBEOB@@@B@B@B  UO0G@B@B@B@B@Bi   @B  rBS MB. :@@  X@,  @B  @B
    ,;7B@@B@B@B@B  @B5   MB@q      @B7    B@          Y@B           :@5.      B@   OOv        @@    B@  i@5 M@.  jB5 kB.  B@  B@
7B@B@B@B@@1r:      ;@B.Z@@O        iB@@r B@j          vB@           ,1@B@B;  :@B   i0B@B@     @B    @B  ,BF MB.   @B 2@5i7@B  @B
 ::    7B@          B@B@u             7@B@B           Y@@                j , r@@        i :0 ,B@    B@LLG@F M@    @@ 0@@B@MZ  B@
       L@B       v@B@@@:     :@B:      B@B@B1.        jB@         :LLkBB@B@B 7@B  :7L0@B@@@B :@@    @@MO@BO BB2B@B@7 Y@       @@
       7B@  .7B@B@B7 :B@u    qB@    .@B@  .@B@:       7@B         O@@B7,     BBO  B@BMi      SB@    B@   :  B@.:i:            B@
  u::.,B@B  LB@Gi     .B@B2.:B@i  uB@B7         rL::,:@B@             :.   ,P@@:      :,  .:uB@r            @B.         .:.  U@@
  B@B@BBS                5B@BM:   MB            v@@@@@Mv              @@B@B@Bv        B@@@B@Bu              M@          .@B@B@X
                          /*****************main*****************/
/*OJ:
  ProblemID:
  Date:
*/
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <cctype>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <complex>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cwchar>
#include <cwctype>
#include <exception>
#include <locale>
#include <numeric>
#include <new>
#include <stdexcept>
#include <limits>
#include <valarray>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <list>
#include <utility>
#include <bitset>
#include <algorithm>
#include <functional>
#define mp make_pair
#define pb push_back
#define all(n) (n).begin,(n).end
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pair<int,int>,int> piii;
typedef vector<int> vi;
const int INF=1e9+7;
/*_____main part_____*/
vector<int> v[500000];
int n,begin,ans;
string s;
int dp[500005];
bool check;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	/*freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);*/
	cin>>n>>s;
	for(int i=0;i<=s.length() ;i++)
	{
		//cout<<i<<endl;
		if(s[i]=='0' and check)
		{
			check=false;
			v[begin].push_back(i-1);
			if(s[i-2]=='1')
			v[begin].push_back(i-2); 
			if(s[i+1]=='1' and i+1<s.length())
			{
				check=true;
				begin=i-1;
				i+=1;
				continue;
			 } 
		}
		if(check and i==s.length() )
		{
			//cout<<"OK";
			v[begin].push_back(i-1); 	
			break;
		}
		if(!check and s[i]=='1' and s[i+1]=='0' and s[i+2]=='1')
		{
			check=true;
			begin=i;
			i+=2;
			continue;
		}
	}
	check=false;
	for(int i=s.length() -1;i>=-1;i--)
	{
		if(s[i]=='0' and check)
		{
			check=false;
			v[i+1].push_back(begin);
			if(s[i+2]=='1')
			v[i+2].push_back(begin); 
			if(s[i-1]=='1' and i-1>0)
			{
				check=true;
				begin=i+1;
				i--;
				continue;
			}
		}
		if(check and i==-1)
		{
			//cout<<"OK";
			v[0].push_back(begin);
			break; 
		}
		if(!check and s[i]=='1' and s[i-1]=='0' and s[i-2]=='1')
		{
			check=true;
			begin=i;
			i-=2;
			continue;
		}
	}
	dp[0]=0;
	for(int i=0;i<s.length() ;i++)
	{
		if(dp[i]==0 and i!=0)
		dp[i]=dp[i-1];
		for(int j=0;j<v[i].size() ;j++)
		{
			dp[v[i][j]]=max(dp[v[i][j]],dp[max(i-1,0)]+v[i][j]-i-1);
			ans=max(ans,dp[v[i][j]]);
		}
	}
	cout<<ans;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:139:27: error: reference to 'begin' is ambiguous
  139 |                         v[begin].push_back(i-1);
      |                           ^~~~~
In file included from a.cc:98:
/usr/include/c++/14/valarray:1238:5: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1227:5: note:                 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)'
 1227 |     begin(valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/string:53,
                 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/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:67:
/usr/include/c++/14/bits/range_access.h:95:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
   95 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note:                 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:                 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
In file included from /usr/include/c++/14/bits/range_access.h:36:
/usr/include/c++/14/initializer_list:88:5: note:                 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
a.cc:121:7: note:                 'int begin'
  121 | int n,begin,ans;
      |       ^~~~~
a.cc:141:27: error: reference to 'begin' is ambiguous
  141 |                         v[begin].push_back(i-2);
      |                           ^~~~~
/usr/include/c++/14/valarray:1238:5: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1227:5: note:                 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)'
 1227 |     begin(valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:95:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
   95 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note:                 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:                 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:                 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
a.cc:121:7: note:                 'int begin'
  121 | int n,begin,ans;
      |       ^~~~~
a.cc:145:33: error: reference to 'begin' is ambiguous
  145 |                                 begin=i-1;
      |                                 ^~~~~
/usr/include/c++/14/valarray:1238:5: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1227:5: note:                 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)'
 1227 |     begin(valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:95:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
   95 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note:                 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:                 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:                 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
a.cc:121:7: note:                 'int begin'
  121 | int n,begin,ans;
      |       ^~~~~
a.cc:153:27: error: reference to 'begin' is ambiguous
  153 |                         v[begin].push_back(i-1);
      |                           ^~~~~
/usr/include/c++/14/valarray:1238:5: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1227:5: note:                 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)'
 1227 |     begin(valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:95:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
   95 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note:                 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:                 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:                 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
a.cc:121:7: note:                 'int begin'
  121 | int n,begin,ans;
      |       ^~~~~
a.cc:159:25: error: reference to 'begin' is ambiguous
  159 |                         begin=i;
      |                         ^~~~~
/usr/include/c++/14/valarray:1238:5: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1227:5: note:                 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)'
 1227 |     begin(valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:95:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
   95 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note:                 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:                 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:                 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
a.cc:121:7: note:                 'int begin'
  121 | int n,begin,ans;
      |       ^~~~~
a.cc:170:42: error: reference to 'begin' is ambiguous
  170 |                         v[i+1].push_back(begin);
      |                                          ^~~~~
/usr/include/c++/14/valarray:1238:5: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1227:5: note:                 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)'
 1227 |     begin(valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:95:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])'
   95 |     begin(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:63:5: note:                 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)'
   63 |     begin(const _Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:                 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:                 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
a.cc:121:7: note:                 'int begin'
  121 | int n,begin,ans;
      |       ^~~~~
a.cc:172:42: error: reference to 'begin' is ambiguous
  172 |                         v[i+2].push_back(begin);
      |                                          ^~~~~
/usr/include/c++/14/valarray:1238:5: note: candidates are: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/valarray:1227:5: note:                 'template<class _Tp> _Tp* std::begin(valarray<_Tp>