10324 - Zeros and Ones

All about problems in Volume CIII. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Re: 10324 - Zeros and Ones

Postby Baset » Mon Sep 12, 2011 1:46 pm

Maybe your compiler does not have an 8 bits size char, or maybe it is another compiler related issue.

I compiled your program with gcc (which is the compiler the online judge uses) and it failed with that input Phone Card Calling Cards
Last edited by Baset on Wed Jun 05, 2013 7:05 pm, edited 1 time in total.
Baset
New poster
 
Posts: 1
Joined: Mon Sep 12, 2011 1:37 pm

10324 - Zeros and Ones

Postby nazmus_20000 » Sat Dec 22, 2012 9:27 am

pls can anyone tell why it is not accepting plzz....


#include<stdio.h>
#include<string.h>
int main()
{
char a[1000001];
int n,i,j,k,l,b=1,c,t;
while(scanf("%s",&a)!=EOF)
{
if(strlen(a)==0)break;
scanf("%d",&n);
for(k=1;k<=n;k++)
{
scanf("%d %d",&i,&j);
if((i>strlen(a)-1)||(j>strlen(a)-1))t=0;
if(i>j)
{
c=i;i=j;j=c;
}
if(k==1)printf("Case %d:\n",b++);
for(l=i;l<j;)
{
if(t==0)
{
printf("No\n");
l=j-1;
break;
}
if(i==j)
{
printf("Yes\n");
l=j-1;
break;
}
if(a[l]==a[l+1])
{
l++;
}
else
{
printf("No\n");
break;
}
}
if(l==j)printf("Yes\n");
}
}
return 0;
}
nazmus_20000
New poster
 
Posts: 7
Joined: Fri Dec 14, 2012 9:01 pm

Re: 10324 - Zeros and Ones

Postby brianfry713 » Sat Dec 29, 2012 10:01 pm

doesn't match the sample i/o
brianfry713
Guru
 
Posts: 1870
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Previous

Return to Volume CIII

Who is online

Users browsing this forum: No registered users and 1 guest