Page 1 of 3

11661 - Burger Time?

Posted: Sun Sep 06, 2009 6:12 am
by MRH
remove...........

Re: 11661 - Burger Time?

Posted: Sun Sep 06, 2009 6:54 am
by saiful_sust
Take input as integer and
TRY this case .........
I think this will helpful.....4 u
INPUT:

Code: Select all

12
DDDDRRRRZDRD
0
OUTPUT:

Code: Select all

0
  • IMPOSSIBLE MEANS I M POSSIBLE

Re: 11661 - Burger Time?

Posted: Sun Sep 06, 2009 7:15 am
by MRH
your given input my code give correct output but Again i gwt WA

plz help me.
thanks in advance

Re: 11661 - Burger Time?

Posted: Sun Sep 06, 2009 1:12 pm
by Chimed
MRH wrote:your given input my code give correct output but Again i gwt WA

plz help me.
thanks in advance
What an ugly code, why didn't you use

Code: Select all

?
Glance of my eyes tells that your reading input is incorrect. Try to read everything once. :wink:

11661 - Burger Time? why WA?

Posted: Sun Sep 06, 2009 9:40 pm
by zer00
please i need some help i dont know why i get WA
this is my code:

Code: Select all

#include<cstdio>
#include<string>
#define MAX 99999999

int main(){
	long L,min,inicio,j;
	bool encontreZ;
	char *calle;
	while(true){
			scanf("%li",&L);
			fflush(stdin);
			if(L==0) break;
			calle=new char[MAX];
			scanf("%s",calle);
			fflush(stdin);
			if((long)strlen(calle)!=L) L=(long)strlen(calle);
			min=MAX;
			for(int i=0;i<L;i++){
				if(calle[i]!='.'){
					encontreZ=false;
					if(calle[i]=='Z'){
						min=0;
						encontreZ=true;
					}
					else if(calle[i]=='D'){
						j=i;inicio=i;
						for(j=j+1;j<L;j++){
							if(calle[j]=='R'){
								if((j-inicio)<min) min=j-inicio;
								i=j;
								break;
							}
							else if(calle[j]=='D'){
								i=j;inicio=j;
							}
							else if(calle[j]=='Z'){
								encontreZ=true;
								min=0;
								break;
							}
							else{}
						}
					}
					else{
						j=i;inicio=i;
						for(j=j+1;j<L;j++){
							if(calle[j]=='D'){
								if((j-inicio)<min) min=j-inicio;
								i=j;
								break;
							}
							else if(calle[j]=='R'){
								i=j;inicio=j;
							}
							else if(calle[j]=='Z'){
								encontreZ=true;
								min=0;
								break;
							}
							else{}
						}
					}
					if(encontreZ==true) break;
				}
			}
		printf("%li\n",min);
		fflush(stdout);
		delete []calle;
	}
	return 0;
}

Re: 11661 - Burger Time? why WA?

Posted: Sat Nov 21, 2009 10:25 pm
by naseef_07cuet
//Code removed after acc

Re: 11661 - Burger Time?

Posted: Sat Nov 21, 2009 10:27 pm
by naseef_07cuet
//code removed after accepted

Re: 11661 - Burger Time? why WA?

Posted: Tue Nov 24, 2009 9:25 am
by naseef_07cuet
Still WA plz help...:(

11661 - Burger Time

Posted: Tue Nov 24, 2009 5:25 pm
by naseef_07cuet

Code: Select all

// Code removed after AC!

Re: 11661-Burger Time. ...Why WA?????

Posted: Fri Dec 25, 2009 8:03 pm
by robot
Hi,
ur program cannot produce proper output..
check this input...
6
D...RD
10
D.......RD
5
D...Z
ans:
1
1
0
ASU(sust)

Re: 11661 - Burger Time?

Posted: Mon Jan 11, 2010 9:03 am
by naseef_07cuet
I got it! Accepted!

11661 - Burger Time?

Posted: Fri May 14, 2010 7:47 am
by sazzadcsedu
Can anyone post me some I\O of this problem .I am tired with this easy problem.
Here is my code

Code: Select all

 
At last Accepted .

Is Any Problem with My Algo??

Re: 11661 - Burger Time?

Posted: Fri May 28, 2010 6:16 pm
by hhjami
Try this input

Input:

Code: Select all

8
R.D...RD
Output:

Code: Select all

1

Re: 11661 - Burger Time?

Posted: Sun May 30, 2010 4:41 pm
by sazzadcsedu
Oh,what a stupid mistake i made!! :oops:
thanx hhjami for your help.

Re: 11661-Burger Time. ...Why WA?????

Posted: Tue Jul 06, 2010 3:02 pm
by naseef_07cuet
I already got accepted before your post.
By the way thank you.