Search found 2 matches

by rmg_91
Thu Jan 26, 2012 9:38 am
Forum: Volume 101 (10100-10199)
Topic: 10176 - Ocean Deep ! - Make it shallow !!
Replies: 37
Views: 18983

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

I found my mistake !!
by rmg_91
Thu Jan 26, 2012 8:25 am
Forum: Volume 101 (10100-10199)
Topic: 10176 - Ocean Deep ! - Make it shallow !!
Replies: 37
Views: 18983

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

Why this code generate WA ,could anybody give some test cases?

#include<cstdio>
#include<string>
#include<iostream>
#define mod 131071
using namespace std;

void doit(string s){
int sol=0;
for(int i=0;i<s.length();i++){
sol*=2;
sol%=mod;
sol=(sol+(int)(s[i]-'0'))%mod;
}
sol%=mod;
if(sol ...

Go to advanced search