11661 - Burger Time?

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

Moderator: Board moderators

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

11661 - Burger Time?

Post by MRH » Sun Sep 06, 2009 6:12 am

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?

Post by saiful_sust » Sun Sep 06, 2009 6:54 am

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?

Post by MRH » Sun Sep 06, 2009 7:15 am

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

plz help me.
thanks in advance

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

Re: 11661 - Burger Time?

Post by Chimed » Sun Sep 06, 2009 1:12 pm

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:

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

11661 - Burger Time? why WA?

Post by zer00 » Sun Sep 06, 2009 9:40 pm

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
Location: CUET,Chittagong,Bangladesh

Re: 11661 - Burger Time? why WA?

Post by naseef_07cuet » Sat Nov 21, 2009 10:25 pm

//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
Location: CUET,Chittagong,Bangladesh

Re: 11661 - Burger Time?

Post by naseef_07cuet » Sat Nov 21, 2009 10:27 pm

//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
Location: CUET,Chittagong,Bangladesh

Re: 11661 - Burger Time? why WA?

Post by naseef_07cuet » Tue Nov 24, 2009 9:25 am

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
Location: CUET,Chittagong,Bangladesh

11661 - Burger Time

Post by naseef_07cuet » Tue Nov 24, 2009 5:25 pm

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?????

Post by robot » Fri Dec 25, 2009 8:03 pm

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
Location: CUET,Chittagong,Bangladesh

Re: 11661 - Burger Time?

Post by naseef_07cuet » Mon Jan 11, 2010 9:03 am

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

sazzadcsedu
Experienced poster
Posts: 136
Joined: Sat Nov 29, 2008 8:01 am
Location: narayangong,bangladesh.
Contact:

11661 - Burger Time?

Post by sazzadcsedu » Fri May 14, 2010 7:47 am

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
For Hints: http://salimsazzad.wordpress.com

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

Re: 11661 - Burger Time?

Post by hhjami » Fri May 28, 2010 6:16 pm

Try this input

Input:

Code: Select all

8
R.D...RD
Output:

Code: Select all

1

sazzadcsedu
Experienced poster
Posts: 136
Joined: Sat Nov 29, 2008 8:01 am
Location: narayangong,bangladesh.
Contact:

Re: 11661 - Burger Time?

Post by sazzadcsedu » Sun May 30, 2010 4:41 pm

Oh,what a stupid mistake i made!! :oops:
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

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm
Location: CUET,Chittagong,Bangladesh

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

Post by naseef_07cuet » Tue Jul 06, 2010 3:02 pm

I already got accepted before your post.
By the way thank you.
If you have determination, you can do anything you want....:)

Post Reply

Return to “Volume 116 (11600-11699)”