... HAVE U TRIED .... AT LEAST 3 TIMES ... OK U CAN SEE THIS ...

Monday, December 30, 2013

UVA-10176 :: Ocean Deep ! - Make it shallow

#include <bits/stdc++.h>
using namespace std ;
int main ()
{
    int i ,a=131071, n=0 ;
    char ch ;
    while ( (ch=getchar() )!=EOF )
    {
         if (ch=='#')
        {
             if (n==0) printf ("YES\n")  ;
             else printf ("NO\n") ;
             n=0 ;
        }

       else if (ch!='\n') n=(n*2+ (ch-'0') ) % a;

    }
   
    return 0 ;
}