#include<cstdio> using namespace std; int main() { int n; scanf("%d",&n); int a[n]; for (int i=0;i<n;i++) scanf("%d",&a[i]); int rest=0; int p=0; for (int i=0;i<n;i++) { if (a[i]==0){ rest++; p=0; } else if (!p){ p=a[i]; } else if (p==3){ p=a[i]; } else if(p==2 && a[i]!=2 ){ p=1; } else if(p==2 && a[i]==2 ){ p=0; rest++; } else if(p==1 && a[i]!=1 ){ p=2; } else if(p==1 && a[i]==1 ){ p=0; rest++; } } printf("%d\n",rest); return 0; }
Wednesday, August 10, 2016
Codeforces 698A - Vacations
Unknown
Studying at Shahjalal University of Science and Technology, Sylhet.
Subscribe to:
Post Comments (Atom)
Edc titanium - Artisan Tools - Etin Iron Art - The Home
ReplyDeleteEdc titanium. Find many great new babyliss pro nano titanium straightener & used titanium watches options 2016 ford fusion energi titanium and get the best deals for Edc 제이티엠허브출장안마 titanium in titanium rings the U.S. at the best online prices at!
c791i3eoqhv453 women sexy toys,dildo,horse dildo,wholesale sex toys,dildos,sex toys,japanese sex dolls,dog dildo,dildo q584z5loynz494
ReplyDelete