Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define mod 131071
- using namespace std;
- int main()
- {
- char c;
- long long num=0;
- while((c=getchar())!=EOF)
- {
- if(c=='#')
- {
- printf("%s\n",num?"NO":"YES");
- num = 0;
- continue;
- }
- if(c!=' ' && c!='\n')
- {
- num = (2*num+(c-48))%mod;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment