Codeforces Round #390 (Div. 2), problem: (A) Lesha and array splitting Solution in C/C++

By | 2017-04-07T22:11:45+00:00 January 6th, 2017|Categories: C/C++, Programming|Tags: , , , , , , , |

Codeforces Round #390 (Div. 2), problem: (A) Lesha and array splitting Solution in C/C++   #include<stdio.h> #include<stdlib.h> typedef unsigned u; u A[111]; int main() { u n,i=-1,j=0; for(scanf("%u",&n);++i<n;j+=A[i])scanf("%u",A+i); if(j){printf("YES\n1\n1 %u\n",n);return 0;} for(i=-1;++i<n&&!A[i];); printf(i!=n?"YES\n2\n1 %u\n%u %u\n":"NO\n",i+1,i+2,n); return 0; }