11661 - Burger Time?
Moderator: Board moderators
11661 - Burger Time?
remove...........
Last edited by MRH on Sun Sep 06, 2009 5:00 pm, edited 3 times in total.
-
- Learning poster
- Posts: 97
- Joined: Fri Aug 22, 2008 10:18 pm
- Location: CSE.SUST.SYLHET
Re: 11661 - Burger Time?
INPUT:Take input as integer and
TRY this case .........
I think this will helpful.....4 u
Code: Select all
12
DDDDRRRRZDRD
0
Code: Select all
0
- IMPOSSIBLE MEANS I M POSSIBLE
Re: 11661 - Burger Time?
your given input my code give correct output but Again i gwt WA
plz help me.
thanks in advance
plz help me.
thanks in advance
Re: 11661 - Burger Time?
What an ugly code, why didn't you useMRH wrote:your given input my code give correct output but Again i gwt WA
plz help me.
thanks in advance
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?
please i need some help i dont know why i get WA
this is my code:
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;
}
-
- Learning poster
- Posts: 62
- Joined: Sat Nov 21, 2009 10:17 pm
- Location: CUET,Chittagong,Bangladesh
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....![:)](./images/smilies/icon_smile.gif)
![:)](./images/smilies/icon_smile.gif)
-
- Learning poster
- Posts: 62
- Joined: Sat Nov 21, 2009 10:17 pm
- Location: CUET,Chittagong,Bangladesh
Re: 11661 - Burger Time?
//code removed after accepted
If you have determination, you can do anything you want....![:)](./images/smilies/icon_smile.gif)
![:)](./images/smilies/icon_smile.gif)
-
- Learning poster
- Posts: 62
- Joined: Sat Nov 21, 2009 10:17 pm
- Location: CUET,Chittagong,Bangladesh
Re: 11661 - Burger Time? why WA?
Still WA plz help...![:(](./images/smilies/icon_frown.gif)
![:(](./images/smilies/icon_frown.gif)
If you have determination, you can do anything you want....![:)](./images/smilies/icon_smile.gif)
![:)](./images/smilies/icon_smile.gif)
-
- Learning poster
- Posts: 62
- Joined: Sat Nov 21, 2009 10:17 pm
- Location: CUET,Chittagong,Bangladesh
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....![:)](./images/smilies/icon_smile.gif)
![:)](./images/smilies/icon_smile.gif)
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)
ur program cannot produce proper output..
check this input...
6
D...RD
10
D.......RD
5
D...Z
ans:
1
1
0
ASU(sust)
-
- Learning poster
- Posts: 62
- Joined: Sat Nov 21, 2009 10:17 pm
- Location: CUET,Chittagong,Bangladesh
Re: 11661 - Burger Time?
I got it! Accepted!
If you have determination, you can do anything you want....![:)](./images/smilies/icon_smile.gif)
![:)](./images/smilies/icon_smile.gif)
-
- Experienced poster
- Posts: 136
- Joined: Sat Nov 29, 2008 8:01 am
- Location: narayangong,bangladesh.
- 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
Is Any Problem with My Algo??
Here is my code
Code: Select all
At last Accepted .
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
For Hints: http://salimsazzad.wordpress.com
http://felix-halim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com
-
- Experienced poster
- Posts: 136
- Joined: Sat Nov 29, 2008 8:01 am
- Location: narayangong,bangladesh.
- Contact:
Re: 11661 - Burger Time?
Oh,what a stupid mistake i made!!
thanx hhjami for your help.
![:oops:](./images/smilies/icon_redface.gif)
thanx hhjami for your help.
Life is more complicated than algorithm.
http://felix-halim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com
http://felix-halim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com
-
- Learning poster
- Posts: 62
- Joined: Sat Nov 21, 2009 10:17 pm
- Location: CUET,Chittagong,Bangladesh
Re: 11661-Burger Time. ...Why WA?????
I already got accepted before your post.
By the way thank you.
By the way thank you.
If you have determination, you can do anything you want....![:)](./images/smilies/icon_smile.gif)
![:)](./images/smilies/icon_smile.gif)