Search found 2 matches
- 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 !!
- 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 ...
#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 ...