A. Case of the Zeros and Ones
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Andrewid the Android is a galaxy-famous detective. In his free time he likes to think about strings containing zeros and ones.

Once he thought about a string of length n consisting of zeroes and ones. Consider the following operation: we choose any two adjacentpositions in the string, and if one them contains 0, and the other contains 1, then we are allowed to remove these two digits from the string, obtaining a string of length n - 2 as a result.

Now Andreid thinks about what is the minimum length of the string that can remain after applying the described operation several times (possibly, zero)? Help him to calculate this number.

Input

First line of the input contains a single integer n (1 ≤ n ≤ 2·105), the length of the string that Andreid has.

The second line contains the string of length n consisting only from zeros and ones.

Output

Output the minimum length of the string that may remain after applying the described operations several times.

Examples
input
41100
output
0
input
501010
output
1
input
811101111
output
6
Note

In the first sample test it is possible to change the string like the following: .

In the second sample test it is possible to change the string like the following: .

In the third sample test it is possible to change the string like the following: 

水题

直接计算s中0和1的个数

然后相减即可

 string s;
 int a,b;

 int main()
 {
     ios_base::sync_with_stdio();

     int n;

     cin>>n;
     cin>>s;

     ;i<n;i++)
     {
         ') a++;
         else b++;
     }

     cout<<abs(a-b)<<endl;

     ;
 }

#include<cmath>#include<math.h>#include<ctype.h>#include<algorithm>#include<bitset>#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<cstdio>#include<cstdlib>#include<cstring>#include<ctime>#include<cwchar>#include<cwctype>#include<deque>#include<exception>#include<fstream>#include<functional>#include<iomanip>#include<ios>#include<iosfwd>#include<iostream>#include<istream>#include<iterator>#include<limits>#include<list>#include<locale>#include<map>#include<memory>#include<new>#include<numeric>#include<ostream>#include<queue>#include<set>#include<sstream>#include<stack>#include<stdexcept>#include<streambuf>#include<string>#include<typeinfo>#include<utility>#include<valarray>#include<vector>#include<string.h>#include<stdlib.h>#include<stdio.h>using namespace std;#define havetxt 0#define shuru "input.txt"#define shuchu "output.txt"#define inf 0x7fffffff#define esp 1e-9#define pb push_back#define mp make_pairtypedef long long ll;
/**(""""******""""""><((\/!_,'.~--```-._!(<>"":::"><(\!'-````~..',_!/\())>"""""""("'\\\\\\\\\\\\\\\/_,^..-``       `~,/(>*"::{{{{{:"*>)\,~        ``-~^''_!\\\\\\':("""""""""""""*>)(\\!,'^~-``-^\>{;=???????????????????;}*\'-``-.^',!/\()>*""""({):::::::::::"*>)(\/_,^.~` ~_){=?????????=+}}}}};??????77?;{<_-``-.^'_!\()>*:::){):::::::::::">)(\!_'^~- -'){=7???????=}7o50Ssaeo7}?????????={)_- -.^'_!/()>*:{>{<{{{{{{{{{:"*<(\!_'^.``.\";?????????=radR#K@Am#ADs?;?????????={\^``.^',!\))>":<{<{{{{{{{{{:*<)\!_'^~` ^)}?7????????}+Z#FQRmBRqA@ABG={=7????????}<,``..'_!\(<*"<}>{{{{}{{{{"><(/_'^.-`')}????????;{ruxQFmqAQRAQFA#QmZ8j}?7???????;<,``~^'_!\)>*<}>}}}}}}}}:*<(\!,^.-`^)+7???????+[0XmBmqRmRRFAppKqqRNEFOr;????????;<^``.^,!\(<*)}*}}}}}}}{"><(/_'.- ~\{????????{zdA#FFmQFmdFFmmRqmRFppQ@Do}????????}\.`-.'_/\)>)+>}}}}}}}}">)\/_^.` ,>=???????{LR@qFNQmBmbXDGydkqmXQ#m@pKQz+???????=*_`-.^,!\)>(+*+++++++}">)\!,^~`-/:???????+nEmA#kPS2l1?;}{{};7ilu8xXA@QQe}??7????}\~`~.'!\)<\+*+++++++{*>)\!,^~ .(}7????7=?kNAg1})\\(()\]%z\)))(\\<;I4KMV}7??????;<'`-.'!\(>(+"++++;+;}*>)\!'^- ^<;7??????=k@NS_*}=??[[=;t7}r][r]7")("RMU;???????=>,`-.'!/(<(;";;;;;;;;">)\_'^- ^<;7??????}OAWO*]]ril]]l1/}vI1ltilzc*=Ab=?7??????=>,`-.'_/(>(=:======;=}><\!,^-`^)+???????=?x@s)?v1le1r}t(]1;[oor]I?<cRe}7???????;<^ -^,!\)>>={=========*)(!_^.`~\{????????;l0C)*>*><>:c[)+l=><<*><>)vS]=????????}(.`~^_!()*:={========;{)\_'.-  .)}=;==;;;}c22\<<<<*>zt["=ju}>*****)55[=???????=*_--.'_\)>+{?{??????=rjl1r=;+{""{?1lllljllIJ&0]r[]r**}?[ci?=>*****>}az[????????}(.`-^_!\)}?{?{??????+3x0asU840U0YaS4ssaTaaaT4s0TTVS"*+7r3jrr}*****<32zi=??????;>'`-.'!\(:??}?}??????;vVvi7LzJlsCjj2CIu3&jcI&3[jO488*{?}]ci}==****)12ojo;?????;*_--.'_!({?7?}?}7777?7=3h&zJ5L22uOe2Os2sL5ne2anz3e4S4<<<>">:">>>><:Iuc}[3;????;>_-`.'_!(}r777+r}77777r=3f8SUS8ST888ST888S48SS88TUS48Tc];}{{{{{}?]1oI+[cj7??7?{(^`-.'_!>?r777r;7+7rrrr7=Jf0Y5u8aY5O4LuY40YS8sOL0OLOa8Ut]?r[rrr[7c3vI[i[r?=??}>!- ~^'_({r[rrrrr;r+rrrrrr=Jf0z1[Ouoi3ei=jsCvnati1Ovj1CS8><*>>>*)>>>(j*!<{=7j[(_.`-.^'/:?[r77rrrr;r+rrrrrr?z%SaLCL4&C50&CY8OT5O40eOsOYOfT***<]&L=>**:I`     ^i{ `~.'\:7][rrrrrrrr;r;rrrr[[rc2z2CC22CCC22as4fCuv7r[31rr772:*">}tc?>"<1} >" `   c(-_)+r][r[[[r[rrrr=[=[[[[[[[r?7777777777=ntiIC=;   ^{7(  (j>***<<>*<?1`_2/"^ ` _I:rii[[[[[[[[[[[[[?]=]]]][[][][]][[[]]]]rjeJze1I~',..z* -~"i}>>>>*}r[\-/Jr}  `` jji[[[[[[]]]]]]]]]?]=]]]]]]]]]][][]]]]]]]?JhV[*rej;\ ;" ^'^,>i[?=7+"*}- rs/^.-- cI[]]]]]]]]]]]]]]]?]=]]]]]]]]]]]]]]]]]]]]rI0a?\=l+};!>{ '1I]iO51+_\r?*>*>eoI[<-`3i[]]]]]]]]]]]]]]]?]?]]]]]]]]]]]]]]]]]]]i]I1,e[e+.;_){" -rneslr{}1i(!'.  (_^+} "zr[ii]]]]]]]]]]]]]?i?iiiiiiiiiiiiiiiiiiii]jI ']r  ?``i^ `<lnn[*+]]o   ,:<  ``^(elcci[[iiiiiiiiiiii717iiii111iiiii1iiiii]i1iz_ r];"/-=< >&0&uCv]!rr1*=35sav\ ^<?{+[n&nl[iiiiiiii11ir1r111111111iii11ollljI1[oov4OYOuC3!/UOvJ2uOaelj&OaLn3Js0c{ItuLOL5a01]1cjjllji1ir1r11111111111i1YsLL5&&unevnlv3CeLLeL2cjIIIoz5a08e3lIIIj2VeLse23ttl2Yzne&5558v]1r1r1111111111it&&CCnnu&5&5sIjIccjvCOVjljjjjjjIn82jIjlljj1Jh5tccIjjj3ae&euuC2uOJ][1r1111111111iOvcjcIIjlv2&StjljljIIluollIjljjlItjljlljjljj&jcjIjjjcL5zvlIjjIcvO]r1r1111111111[OvjljIllIIIjn3jlcj3jljclllulIlojjIjjojcostotljzol2Jlt2lvvovcjlI&21]1+rrrrrrrrr7?1uIilvi1zc11i1itz]JJ]ii11itniju1jIcIecce&CuC2s5cu5tztCzvuuzoe2L&v2I*/
//%%%%%%%%%%%%%%%%%%%//不薅羊毛不舒服斯基//不薅羊毛不舒服斯基//不薅羊毛不舒服斯基//orz_lzt_orz_lzt//orz_lzt_orz_lzt//orz_lzt_orz_lzt//洪荒之力洪荒之力//洪荒之力洪荒之力//洪荒之力洪荒之力//%%%%%%%%%%%%%%%%%%%
/*;;;;;;;;;;;;;;;;;;;;;;;;;+}:*>>><)(\\/!_,''^^.~-`` `^_()"{;????????????????????7==;yR9X@wQKl)**iVv"):+{:">))>><(*}7{:8o\\:[}.oT\:{*\){+:"(*<!{;_\^&bz<}*{}\3B#AM9}?=+177?????????????????7?=}:<\!'~``---..^'',_!!/\())<>*"::;;;;;;;;;;;;;;;;;;;;;;;;;;}:*>>><)(\\/!_,''^^.~-`` `^_()"{;?7???????????????????7=?$QkXmd@Fc!+IVr*<+}!!";+;?]ir=>)(}}0C>}))**YO)={=28Vfhf9T5CI+}!?';pf({}>\uBBNEs+?ii}?r?????????????????7?=}:<\!'~``---..^'',_!!/\())<<*"::;;;;;;;;;;;;;;;;;;;;;;;;==;{">>*<))\\/!!,,'^..---` `._\)*{;?7???????????????????;[;u@yDHNBRc_cu}>>\!(?3&4YXF98OfJ;\?>C4'}{>{\us)(i9Sv"_OBg}uu4hf&j+(;Ve<"<:uKwgMP=?7;?c;?????????????????7?;{"<\_^-``---.^''',_!!/\()<>*>:{{;;;;;;;;;;;;;;;;;;;;;;;;;;;}">**<<)(\/!!_,,^..---` `._\)*:;=?????????????????????:i{&WQR#@#l){)>>&Dw5=\,!,6A2jYOV4?)*e0\")":\au)\J0s4CrJS&]vv3vteVfU]\*)"?!hAdMyi"7r?=r????????????????????+{*)\_^- `---.^'',__!/\\()<>*>:++=====================;==;==+:*>><<)(\/!!_,,^..~--` `._\(*:+=?????????????????????r;?jyXQpgEO)*>*[4y$sO00Ua9$88&c]\)[(lU/}){"/83(*_}3zLT&&LYOa0&zr{({:"+><*<fBEp0+=r?==?r??????????????????=+:*)/,^- `---.^'',_!!/\\()<>>>{;;======================;=;==;{*>>><)(\/!!_,,'^.~~-` `.,/(>"+=?????????????????????1:r=hVFR9mL><<+;"<:7i11]c["":\!\**>)v8\+<{"/Ut)};>\!/*\=>*<)!,)"/)(<{"::)>V@FSa:[r=??=r???????????????????+:*(/,.` `-~~.^',,__/\\())<>>*}==========================;=?;}"*>><)(\/!!__,'^.~~-` `.,/(>"}=????????????????????+rr7;xvLB@Kc);*")>*"*>(!(\>")):+>?{("28/{>*"\ft<*:)*{\)7(\>*":"};"?)"}>*+:*gN8&S>]?7rr==??????????????????=}">(!'.` `-~~.^',,_!!\\())<>>"+==========================;=?=}"*>><)(\\/!__,'^.~~~` `.,/(>"}=????????????????????rr1{:azrpNKi\;}):;+>*;=:;)*={{=":(*{*vh(""):(Vt(}:}{*+}(*;:>)::)>";)>)"+<>{Zq3eu*i;[77==????????????????=?=}">(!'.` `-~~.^',,_!!\(())<>>{;?=========================+=?=}"*>><)((\//__,'^..~~```.,!\>"+=????????????????????=?[;7CS{USZC(!+{{<)":>>:>+:><>"<"<{*|ch>*{)})Ul/{)>>>}**>>\}:**:*{));<}>*)7V92st}c;[;??7????????????????=?=}">(!'.` `-~~^^',,_!!\(())>>>};?==============================}">><)(\\!!__,'^...~-``-^!()*{;???====??????????????=[7{lV+0vTj/}>***********"""***>+\ragL{}>>))hhTc)*{{<"<**************""*)]GVIhr???=====??????????????????={">\_'~``-~~~^'',_!//\\())<**}+;==============================+">><)((\!!__,'^...~-``-^_\)>:+???=?==????????????????7}IhrLCTl(:>**************""""\]geco!)>;:(=lSkz/=):""**************""*>igU]%=7???=?????????????????????;{*<\_'~``~~~.^'',_!//\(((<>*";;;==============================+{*><)((\/!!__'^^^.~-``-._\)>:+=???=???????????????=r=7}[xl3YSo)*"*********"*****:::{bc)*!:{(:">)*!Yx[{/?"<**************"">>lb0r%{77???????????????????????=;:*)/,^-`-~~~.^''__!/\(())<>*"==================================}**>))((/!!!_,'^^.~-```.,!(<"};???????????????????=];r;=fz]SS3*<:*********"**>>*""'UU~}{::)***}}?"!f4!>+<>**************""*\uXe1V{77??????????????????????==+"<(!'^-`-~~~.^',__!/\()<<<>"{?============================??==7={**>))(\///_,'^^^~--``-^'\(*{;=???????????????????r=r7}5O>ST&"):>***********"**>>JG;("c":{)(<\?i?>:%i>{>>***************"*(%d?O5+???=====????????????????=;{>(\_^-``-~~.^'',_!/\\()>>>*}==============================7?;=7={**><))(\\/!_'^^^~~-``-.'\(>:+=???==?????????????r;=??+24(0UY*)"*************""":?9]>Uhf?>(+)70kD;7%]);:(**************"">}9d"4e{7??==???????????????????;;{<(!,.-``~~~.''',_!/\\\)>>>";7;;=?=========================7?==r?}"*><))(\\/!_''^^~~-``-.^/(>:}=??===?????????????[}=;?;3U(YVa*<"*************":}+'$Y4S16s^:",hs70U4T!>>*{**************"")i%X)8e:77??????????????????????=+:<\!,.-``-~~.''',_!/\\\)>>*:;r+;=?=================???==??rr;r?+;?"*<))(((!!__,''''.~~-`~'!\)*{;=?=======??????????;r+?>u%!LUar)<<*""""""*")+**){)"+dw;_[w5?}f%:=}d9?))"*>********">"<:{\}_2Tg)9t}7????????????????===????;{">(_^-```-~.^^',__!/\(\)<<*+?======================???==??;}+rr??=+{*>))(\\\/!__,,^~~~-`-^_/)*}=?r77?????=????????==1[i"2S!Lssr/}}"""::""";>*<"<:(=!=[:;7[Ushu""<>{?)}+}*"**********">**<{\L9x(x3}7????????????????===???=+{*<\_.-```-~.^^,,_!!/\(()<>:;??====????????????????=???===?crr=;;=;+:>(\\!___,'^.~~^....-~^',/)*{+;7?==?==+========;+=}?"CU!OYUl\{>>*******(<>}}<{:*"">\)"\>?:"*=>;*{(>)\)}********>"*"<<{**8Gs\fz}7????????????????==???==}:>)/,.```--~.^',,_!!/())(<:;=??====????????????????????==??:>?+}}?==}>)<<(\///!!_,,,,__,'',!/(<*{}+7?==??=;========[?;}?+uU(C&Sv**)""""""""}?(::(*"):{*:{"""{\>_\;!}}**************>">{><;\?She\f3;7?????????????????=???=;{*<\!'~``--~.^^',_!!!\())(<}?==?????????????????????????????rj%6GGkPgG$9$66$99999999x%9%%%x%%%99$GGGPGGGPZPGGGGGGGGGGPPPZ%yphDdFg$xP99$$$$999T)>{":<}>>){:/?)<(>c})[)<">:+:)*********">{**+!v0YL\xt+7?????????????????????=+">(/,^-`---~.^^'__!!/\())(>+?==???????????????????????7??=??+cZG%h6x99%%9$66999$$66696G6$$$99999%%99%%%%%%%9%%%%%%%%fxx99Ufffxx%V%UGx%%%9%%%yw>"{{{>>*={}{=UTzCUO>}<"<})(>">********"">::":\a5n0(fv{7????????????????????=;}*<\_'.- ---~.^''__!//\()))";?===??????????????????????7??=?7?1PUO&0OOOYsssa0YYYsssasLOOL5LL5sssYYYYsOYssOLOsYYYYYYYY44s00s40L0LsOs5YYsssssssa6("<)><}+<(>\\7a6aOl(=<{/}:{*"{*********>"*":>}h320(Su:7????????????????????=;}>)/,^~` ---..^',__//\\()(*+;=??=??????????????????????77???7}]gx84fSa4SS88STSSSSSSSSSUU88STS888888SS8SUT408SSSSSSSSS8Ss888S00xsTS8US888SSSSSSD){"{:*<}/}Jzzi{.{CL988l\><*(<{*********>:<":)[91zO\0s:7????????????????????=;}<(!,.-` --~.^^''_!!/\\))({==;??????????????????????????????7+jySsOeOSVerCfS0sO5JaTvC8aT&h8szu2OTS88S8Oz5tvYSSS8a0Ct0S32TVsLV4Yea2Cs800444488Ug>""">*>\ox8ee25Y94j?[eG8[(}?>!***********{(}>Of<eO)Ls}??????====???=???====+{")(!'~```-~.^^',_!_!\)((>*}?r?;=????????????????????????????7;jk8843?ejccoeO0SsJ=z4j?ssa4L37Ie"t0&YassljOztc[cuST42IL8?IS0s4L8j:0vrV804444000fZ(*{{>>:&4l"<))rO5*|}*_7a9z(\+r********}*<:}{<%e,39<CT}[7?=?7?===??==???==?=+{*(\,.-``--~.^^',_!_!\(()*:+7r?=?7???????????????????????????7:1wT8TLzC:[J1tY88VV&LsoI0S0Yr*<Co;il=Is&"<t&lO5o*zTLj{;O17?1nUx03=?sJ{[&00444004hZ\>*<):&2?\)}:)>!(}>){>)\JGY"\>********"*>**(]Au"Cx/[y:[r?=????????????????;}">\_'~``-~-~.^^',_!/\(((>{+=?r7777???????????????????????????7;[kTe3lJ2}rj{ceLv[[vaO]?cnSsncr&i&32zoO2}"L5raT0?24YeI}1rO&?*[uYn]?t3o=lYa004488TP<:""7Jz{\"")>+*j}/*:}*?/)ii{"}********<>"{\>Yyx})%+;G[?77????7???????????=;{>(/_.-``~.~~^^'',!_/\(\)"+????777???????????????????????7????77rZT53r{0vcI=2O0Yi"IT0c[v208VL[Juujns&YOs=eO]5Y0}z80Ov?jrijj}[a4o1=2lvsvYa004488Ug*{*>+j);}>*+o8$Uxgu*{*(;+>":><""****"""<>;\j$]a0jb++82}=rr=;=r????????7?=;}")\/,.-`-~~~.^'',_!_/(((<{;7?==?7??????7777777777777777??7???7r}[wU0Su7Yj;r}3u40aJvseclV4aSau}L&rci]&4Vs=25ca40*2T&1}r0clivuL0nriI2]izOa0444004fg)**<()+,};!zg&i1=3xTj<*}>){>)+""****""{*>:(&%!rGGO*>Ss{;rr?;=7????77???=;}:>(!!'~``-~~..^''_!!!\(()*}=7?=?????7777777777777777777???77??7r?[kfsaC?v[io>zYYOTI}unr105SzV&7ozs=zLiOOac3ucO4a[uS8YJo4loce00fYOJIuoc3ua0444488Uw>))"*>{>>**":*:>{)>+<"})*}>*:)""****""*:>)5g/>"(){><?G7?=????=?????????;}">)\!.-  `~.~.^'',_!/\())*+????77??7r7777777777777777777?7?7r7?7[=ckS083*&t=[?[[l40i7i;7{;+;La5?JSz}uSJC0a[cIt88sr2au[;v4ri3liOTt?====??r1n4S0088SZ**)""**""**""*><<>":::*><>***"">>":{:>)+(rX9u!+"")="1Ur?==77?;????777??;:>)\_,~-`-~..~^',!/!_,\(()}]i?????????7777777777777777777?7?7r7?7[+cbTs4Oz0l[&ncrC0Ll2uo2C11]LYLiuOj:nULa8s[1lnS0s1Csu]72V&c}[eSLj[I3n2or{[zs0aaaafZ\((>{**""*>**>:""*"*>>{">**><<*>*:>(>}+{{gCvdj(";(}/l6????????????7??=;}"<(!,^-``-~...'',_!/!!(\):=rrr????77777777777777777777777?7?7rr?7[+cbUs4SSsuuSU8sTU8OUUYUUas&848C8aClsUaSa8uOa08sVeY40YLs8aau&Ta5T88844aasCYSTSS84Tk(}{>:<*"*>>**>***"""*>{**""**")=}>}"(*{,VP[+3GI/:++)sO;?r7=;?r?????=;;{:>(/,^~````~...',,_!/\\((*=r==[7777rrrr777777777777777777777?7rr?7[=1wV0840aS8aaVSY488TaaVYUSa808LUS40U0OSY44U84Y&U0aa8UT0LsVSaVSYTaaaaa0040880a088Uw({>\{:>>****"*>>>*"""***>"""":?\<}){?<(0Gi=?{uGI*|/[P3+?r7==?[????==;}">)\_'~````-~.^^,___!!\((>}rr==r77777777777777777777777777777?7rr77[?ikV48aYS0aa0saaaaa0YaTOaaa0s8sUs0SSsaV8a80OSTY0884ass08s44a0S4Y48SST84044ass088Uk(}{"+:*******""*****><*****>>>"+{>*>)>YXj=}c[:tZ0rch9{==?????777??=;}:*<\!'.-```--~.^',_!!!!\\)}rr???=7777777777777777777777777777r77rr77[;1DVa4888s08V0SVU0aSS48S4aS808aS000aaSU0aU8sSU88888488SS4sSUYYTUS8assa8S88888884S6(**}"<:"*"">>***>***"****""**"{*\{?/"Ugj"i[7{r{luP9nr}????????77?==+:*<(!,^.-`--~~..^',_////()"?[7?rr=??????77rrrr7777777777777777r77rr77[;cDUs8SS8SUa4s0OS0a08aO88s80ssOsTS8a4SaasSS00sa8ass0TT0OUOO44080a08STTS844040asYVkr"\")**>>*">*""*>*":{{**"{:*":))=>!LXUI}?+i*]=?+;r}?];???????????=;{">(/_^.--`-~....',_!///(<*?7r77r7?777777rrrrrr7777777777777777r77rr77[=ckSsT8Y80TaSsSSsUUs4T4S8O88048Ss48a80sVS0Y8U8844ST8as4T0888SS0084444444800488ST8Q6U3j<*)()>"*"{+}:*""*""""">)()>;7ngG2[{ri?;?7;[?="[7;[?77??=???==;}:>(\!^.-```~.^^.^',_!///("}i7=r[??rrrrrrrrrrrrr77777777rrrrrrrrr77r7?7[=1yUs8444SS008840S8ST0sVsUTYs48400Y4T0a4a400880a4440488480aUsS804asha4SS4S4a88aaUk7ufgh5Jj7"(\())))<<<<<()))><:iz6GVO?{=i[7?====;?]1r};r???????=?=;}:*)\_'~```--...^^,_/!__/(>}?[[[r77?77777777777777777777777rrrrrrr77r7?7[=1yUs844TasSSssSTsY0088sS054SVa0a00448S044S8s4U8Saa88a0S8T4T08s480S8saU0a484S888hd>/=8%Y8SS4OntI????===;;?[lu0$Fw5;{}7c}+}};r[r=r=;;==?????????==;}{"<(!'.- ``--~.^^',_!\!!(*{;r[rrrrr777777777777777777777777rrrrr7r77rr7r]=1yUs884TTTS0YLOUaaS4aas40TusYf0Ts80L4Ta0a0ST848aST40S8aU00Saa00TYSSTOY8S08T84448Q8fv)\;"*<)<"};r[[[]]]]77;:*(\>j965ir{>}=r[?=?[=rr;}=77?????=;;{:*<(/_^-````~..^',__!!//\>{?r[[777rrrrrrrrrrrrrrrrr77777777rrrrrrrrr77rr7r]=1yUs884s3zaLcc58U8402zT2oc[l545sLOl1Y8uOS00TLnS4840a0885C482CS4OaSYv3vYOCus04S08qc?*::(::""*>>>)))<<<<<<>)(>>*+,*jV9UnOj?*>}r7;+r]r7rr=?777?=;+"*<(/_'.-` `-.^^^'__!!/\!){?77rr777rrr[[rrrrrrrrrrrrrrrrrrrrrr[[[[[rr77rr7r]=1yUs884&lluJ;+o20004lre&J1ula8V8z3r;Io3SVYLSLltT0aS8s4fcl0Li1a0Y45j[u3unjvLs08af6(>))*}>*:}}{"*****>>><<"::}:>*=*<*{xGesTULc{:;{}}=r]r;??7?=;}{>)(!_'.~````.^^^^',__!/\(:?r7777777rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr77rr7r]=1yUs8844LuCtr;7s808x42Cztv5lnOaatvI[7+tO040SSC;&s8S840s]v&I=}jof0uioYCuz13a8SU8fy:*)"{{>***""""""""""**{{<(>*"}*(>"(el.{=jLf%4e3c={"{=r??==;{"*(\!,'.~`-`-~.^^^^',__!\){=rr77r77rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr7r]=1yUs884J]rot][llL0n11C82oL2LOUu;]v;{[:+<ISSeaO+[LUsYTYj{c1>rri1SnC[I]=3?*i5Ys4sVG)**"""::"""***>>>*****<"**{:><"})<=0r```--':l5VVUazr{}===;}:>)\!,^.-` ---~^^^^,__!!\)>?r[77r[7rrrrrrrrrrrrrrrrrrrrrrrrrrrr77rrrrrrrrrr77r[=cDVs44042Iz[lJcvYT&j+?Yt?7rvSaIIuu1=c33l24O0silc;YV&SSJ:tt[IJzu0U8I]niuo+CY4fO4Vw)*">::>+><+{>"(""*}:)+<>""**":**}<;8/~~---``--^>ieU9Va1(=:\})!_'^~---``-.^^^^^,',!\){7rrrrrrrr777777rrrrrrrrrrrrrrrrrrrrrr77rrrrrrrrrr7rr[;iyTs440T&jOzoJ?3s8LaLoCjc;]1j0V0u]{?ijJL80TUi"05=[Sha8Vl2zvtlteU&v1?Lo5u;j80YSSUk(>><**"*>{"<"{}"*>/){(*****""":""\IS/-``````--`..`-)oa%5'"?./\'^~----`..^^^'',!,,\>:=rrrrrrrrr77777777rrrrrrrrrrrrrrrrrrrr77rrrrrrrrrrrr[[;1yUs8840u[utrJ]uSTs0ui21l"cj}z3]?>;227:sS0Ol;v802{cYLsL;1l1it&0Tz3L[v7CctruU5O0Vw)**>"*{)*{<<">>{*>"*<){">>*"""*{*_CO'-`````--- ~,^``~^cpo')!!..-```---...^^',_!_!)}?rrrrrrrrrrrr777777rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr[]?cDUs400lc7lr+vlO&nYU3{JnC[2&e41:3Jc3JccL0si*3UOYTI(?ue77C&i=C0LeL4scJrj=0cra8aaVy)"">"*"*")<:::>"eTYt*":"*>*""*)}*!Ot`---``````'-  `--``Ib{\-/-``  `-~~..^'''_!//){?[[rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr[]=cyUY0aaC252c[7++=jsUj:n1+}?;2fn4Sl*iz1+84O1o0sSs4L7?e&oLTS3=7r"]ss=14C[l4z"1SfOUk)**<*>>:*(::}ev^VDj7:<*"""****>{)(Si`--`-`````  `-~--~'`O6'-/``  `-...^,___,_!(>}?[][7rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr[[[[rr[]=cyUs844V8xs55or>iLS43j4zrJz1eVSO4ucjj1lhL4saUOV8YUL2a088ss0ur}73aY[eUOzeTOrvSa0Tk)**>*>>"">+)+yv~nY\<*}>"::****{"/}f?^. ```----^.-   `'~.^wi_^ ```-~.^^'_!_,'_!";[]][[rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr[[[[rr[]=cDVs4444Y8OSUU0ss88Uf00TOUV8TaaS4OY84aSU5TUsTTa08T0sSS00aaf94OTTSS8V8YSsfS&VVLfTk)""*:"*<{*:)+6XfmXse])**"***"*{>(1S)^.````--~~    -` ` ~ rD' '----.^^^^,__,_(*=ri[rr[[[rrrr[[rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr[[[rr[];ikSLsYOaasO4&8s0Y0OL4aLY4Yesa5saa044aYO4fsL40YaaSeOTaa5&UsCY8O5aLLsuOYsOeO8YLss8g(**>"**<+<):{z4L9GaxV::*>>*""*>>*vL -.--------~---   ~``! hv ----~.^^.'_!!/<}r[][?=r[[rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr][]][7[c[]yp%Zx$66666$$96666666666G66666Z%%9%6U9Vfx9ZUG996Gf6kxZPZZPPZP6k6PP6kkZZPPPPGPPyg(<<";)"**":>(/!-t0_0g,****""""})>43.  ~- ^_.'      -` `-' r9!`....^^'_\,^!"7r7rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr][[]r7[17rV6VG%$%%9999$$$$$$$$$$99999999VG$G%FEmFAwFZpkV%UxFL404T84484aYaxYxUsLsaaaaaaaay%}"*">>"""*)>;1T0kS)I4}"""*"****);Ti -`. ~1v -^ `~-   `` ~ _x]-.'^.''^''_("=rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr[[[[r7rii=[;"+;?}+++;;;;;;;;;;;;}}}}+++;;=?>181e%y0S&we^_!=U:`^.```--`._.`_-`^'--````---vL,*>*>}>"{"<)}[O5a[><[<"""*"***>)]U) ~-~~^5u `~  ``  `-``-~`uU^`,^~_!'!_)}r[[r[rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr[[[[[[[[[[[[[[[[[[[[rr[]?7=r111iiii]][][]]]]]]]][[]]]]]i1[c?nh'!}CV9xwfi)(}L8~~.`-.^--(70..^.-`,------~~)x_=">*>***::>)()>*_}>*\***"*"""*(vs`'``-.`a?^-`^`  `-`` ~-~~(y<`_'~_!_)";r]r7r][[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[*/
string s;int a,b;
int main(){    ios_base::sync_with_stdio(0);
int n;cin>>n;cin>>s;for(int i=0;i<n;i++){if(s[i]=='0') a++;else b++;}cout<<abs(a-b)<<endl;
return 0;}

Codeforces 556 A Case of the Zeros and Ones的更多相关文章

  1. Codeforces 556A:Case of the Zeros and Ones

    A. Case of the Zeros and Ones time limit per test 1 second memory limit per test 256 megabytes input ...

  2. 【52.49%】【codeforces 556A】Case of the Zeros and Ones

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  3. Codeforces Round #310 (Div. 2) A. Case of the Zeros and Ones 水题

    A. Case of the Zeros and Ones Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/con ...

  4. 找规律/贪心 Codeforces Round #310 (Div. 2) A. Case of the Zeros and Ones

    题目传送门 /* 找规律/贪心:ans = n - 01匹配的总数,水 */ #include <cstdio> #include <iostream> #include &l ...

  5. Case of the Zeros and Ones 分类: CF 2015-07-24 11:05 15人阅读 评论(0) 收藏

    A. Case of the Zeros and Ones time limit per test 1 second memory limit per test 256 megabytes input ...

  6. A. Case of the Zeros and Ones----解题报告

    A. Case of the Zeros and Ones Description Andrewid the Android is a galaxy-famous detective. In his ...

  7. Codeforces 556A Case of the Zeros and Ones(消除01)

    Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u   Description Andr ...

  8. CodeForces - 556A Case of the Zeros and Ones

    //////////////////////////////////////////////////////////////////////////////////////////////////// ...

  9. CodeForces 556 --Case of Fake Numbers

    B. Case of Fake Numbers time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

随机推荐

  1. JS如何实现真正的对象常量

    前言 众所周知ES6新增的const关键字可以用来声明常量,但是它只对基本数据类型生效(Number.String.Boolean等),那如果我们想声明一个常量对象呢?该如何实现,Object内置对象 ...

  2. Swift三元条件运算

    三元条件运算的特殊在于它是有三个操作数的运算符,它的原型是问题?答案1:答案2.它简洁地表达根据问题成立与否作出二选一的操作.如果问题成立,返回答案1的结果; 如果不成立,返回答案2的结果. 使用三元 ...

  3. windows环境下,怎么解决无法使用ping命令

    基本都是因为"环境变量"导致的,查看环境变量path在"Path"中追加"C:\Windows\System32"

  4. Kafka 源代码分析.

    这里记录kafka源代码笔记.(代码版本是0.8.2.1) kafka的源代码如何下载.这里简单说一下. git clone https://git-wip-us.apache.org/repos/a ...

  5. ajax来判断用户是否登录与添加

    首先在用ajax之前,先说一下JSON: JSON:javascript object notation   js对象标记 对于json,我们只需要知道如何定义json?如何输出?怎么遍历? 1.定义 ...

  6. Android开发随手记

    本文是作者在Android开发实践中的随手速记,记录一些小问题的解决方案和注意事项,持续更新. 以下是速记内容,若有不严谨的地方,望小伙伴们指出. 1.Module 不生成R文件,可尝试取消对该Mod ...

  7. python编程快速上手之第10章实践项目参考答案

      本章主要讲了python程序的调试,当程序有BUG或异常的时候,我们如何调试代码找出问题点.其实在本章之前的章节我们做练习的时候都会遇到各种各样的错语和异常,最初当不知道程序哪里出错的情况下不可否 ...

  8. 针对双系统ubuntu16.04卡死及系统没有声音解决方法

    楼主电脑系统状况:win10主系统,128固态为ubuntu系统       安装一共为两次. 第一次出现ubuntu安装成功后没有声音,主系统win10有声音,Ubuntu上检测不到声卡,说明ubu ...

  9. CSS 选择器优先级问题

    <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> &l ...

  10. 基本的传染病模型:SI、SIS、SIR及其Python代码实现

    本文主要参考博客:http://chengjunwang.com/en/2013/08/learn-basic-epidemic-models-with-python/.该博客有一些笔误,并且有些地方 ...