## 11661 - Burger Time?

Moderator: Board moderators

MRH
Learning poster
Posts: 51
Joined: Mon Aug 11, 2008 9:09 pm

### 11661 - Burger Time?

remove...........
Last edited by MRH on Sun Sep 06, 2009 5:00 pm, edited 3 times in total.

saiful_sust
Learning poster
Posts: 97
Joined: Fri Aug 22, 2008 10:18 pm
Location: CSE.SUST.SYLHET

### Re: 11661 - Burger Time?

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

MRH
Learning poster
Posts: 51
Joined: Mon Aug 11, 2008 9:09 pm

### Re: 11661 - Burger Time?

your given input my code give correct output but Again i gwt WA

plz help me.

Chimed
New poster
Posts: 12
Joined: Mon Oct 20, 2008 10:37 am

### Re: 11661 - Burger Time?

MRH wrote:your given input my code give correct output but Again i gwt WA

plz help me.
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:

zer00
New poster
Posts: 1
Joined: Sun Sep 06, 2009 9:09 pm

### 11661 - Burger Time? why WA?

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;
}

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm

### Re: 11661 - Burger Time? why WA?

//Code removed after acc
Last edited by naseef_07cuet on Sun Feb 21, 2010 9:59 am, edited 1 time in total.
If you have determination, you can do anything you want....

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm

### Re: 11661 - Burger Time?

//code removed after accepted
If you have determination, you can do anything you want....

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm

### Re: 11661 - Burger Time? why WA?

Still WA plz help...
If you have determination, you can do anything you want....

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm

### 11661 - Burger Time

Code: Select all

// Code removed after AC!
Last edited by naseef_07cuet on Tue Jul 06, 2010 3:01 pm, edited 1 time in total.
If you have determination, you can do anything you want....

robot
New poster
Posts: 29
Joined: Sun May 24, 2009 8:39 pm

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

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)

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm

### Re: 11661 - Burger Time?

I got it! Accepted!
If you have determination, you can do anything you want....

Experienced poster
Posts: 136
Joined: Sat Nov 29, 2008 8:01 am
Contact:

### 11661 - Burger Time?

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??
Last edited by sazzadcsedu on Sun May 30, 2010 4:43 pm, edited 1 time in total.
Life is more complicated than algorithm.
http://felix-halim.net/uva/hunting.php?id=32359

hhjami
New poster
Posts: 1
Joined: Fri May 28, 2010 6:02 pm

### Re: 11661 - Burger Time?

Try this input

Input:

Code: Select all

8
R.D...RD
Output:

Code: Select all

1

Experienced poster
Posts: 136
Joined: Sat Nov 29, 2008 8:01 am
Contact:

### Re: 11661 - Burger Time?

Oh,what a stupid mistake i made!!
Life is more complicated than algorithm.
http://felix-halim.net/uva/hunting.php?id=32359