12157 - Tariff Plan

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

Moderator: Board moderators

Post Reply
uvasarker
Learning poster
Posts: 96
Joined: Tue Jul 19, 2011 12:19 pm
Location: Dhaka, Bangladesh
Contact:

12157 - Tariff Plan

Post by uvasarker » Sun Jan 01, 2012 4:35 pm

Please, give me some critical test cases or please tell me where is wrong in my code. Here is my code:

Code: Select all

#include <stdio.h>

int main()
{
	int T,cas=0;
	scanf("%d",&T);
	while(T--)
	{
			int N,cal[3000];
			scanf("%d",&N);
			for(int I=0 ; I<N ; I++)
				scanf("%d",&cal[I]);
			long mile=0,juice=0;
			for(int I=0 ; I<N ; I++)
			{
                          [b]/*  Very Simple just see below  */[/b]
                         }
	}
	return 0;
}

Last edited by uvasarker on Thu Jan 05, 2012 9:40 pm, edited 1 time in total.

leobonalume
New poster
Posts: 5
Joined: Mon May 09, 2011 8:49 pm

Re: 12157 Tariff Plan Why WA? Please, help me

Post by leobonalume » Mon Jan 02, 2012 8:02 pm

uvasarker wrote:Please, give me some critical test cases or please tell me where is wrong in my code.
try this

Input

Code: Select all

3
1
119
2
29 59
3
29 59 119
Output

Code: Select all

Case 1: Juice 30
Case 2: Mile Juice 30
Case 3: Juice 60

uvasarker
Learning poster
Posts: 96
Joined: Tue Jul 19, 2011 12:19 pm
Location: Dhaka, Bangladesh
Contact:

Re: 12157 Tariff Plan Why WA? Please, help me

Post by uvasarker » Wed Jan 04, 2012 9:32 am

Still WA............. please give me more critical test cases.
My modified code is:

Code: Select all

Removed after AC. very simple just check the below test cases
Thanks a lot.
Thanks a lot "leobonalume" bro
Last edited by uvasarker on Mon Dec 03, 2012 10:17 pm, edited 2 times in total.

leobonalume
New poster
Posts: 5
Joined: Mon May 09, 2011 8:49 pm

Re: 12157 Tariff Plan Why WA? Please, help me

Post by leobonalume » Thu Jan 05, 2012 1:29 pm

uvasarker wrote:Still WA............. please give me more critical test cases.
You're failing at the inputs below.

input

Code: Select all

12
2
60 65
3
100 30 29
2
29 60
4
30 60 120 120
1
60
2
60 30
6
29 30 59 60 119 120
13
150 30 10 10 20 60 29 30 43 39 1 23 54
5
10 20 30 40 50
5
10 31 29 30 59
30
30 29 30 29 30 29 30 29 30 29 59 60 59 60 59 60 59 60 59 60 119 120 119 120 119 120 119 120 119 120
4
60 10 10 10
output

Code: Select all

Case 1: Mile Juice 60
Case 2: Juice 60
Case 3: Mile 40
Case 4: Juice 135
Case 5: Mile Juice 30
Case 6: Juice 45
Case 7: Juice 150
Case 8: Juice 240
Case 9: Juice 75
Case 10: Juice 75
Case 11: Juice 750
Case 12: Mile 60

sumaiyyah
New poster
Posts: 2
Joined: Sat Jun 02, 2012 2:39 pm

12157

Post by sumaiyyah » Fri Sep 28, 2012 4:36 pm

i cant find my mistake. plz help.

Code: Select all

#include<stdio.h>
#include<math.h>
int main()
{
	long int t,caze,mile,juice,sum2,sum1,n,i;
	double num;
	scanf("%ld",&caze);
	for(t=1;t<=caze;t++)
	{
		scanf("%ld",&n);
		sum1=0;
		sum2=0;
		for(i=0;i<n;i++)
		{
			scanf("%lf",&num);
		
		mile=ceil(num/30);
		mile*=10;
		sum1+=mile;
		juice=ceil(num/60);
		juice*=15;
		sum2+=juice;
		}
		if(sum1<sum2)
			printf("Case %ld: Mile %ld\n",t,sum1);
		else if(sum1==sum2)
			printf("Case %ld: Mile Juice %ld\n",t,sum1);
		else
			printf("Case %ld: Juice %ld\n",t,sum2);


	}
	return 0;
}
	

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 12157

Post by brianfry713 » Fri Sep 28, 2012 8:33 pm

Doesn't match the sample I/O.
Check input and AC output for thousands of problems on uDebug!

sumaiyyah
New poster
Posts: 2
Joined: Sat Jun 02, 2012 2:39 pm

Re: 12157

Post by sumaiyyah » Sat Sep 29, 2012 3:02 pm

brianfry713 wrote:Doesn't match the sample I/O.
i solved it. :D

zipu_sub
New poster
Posts: 1
Joined: Mon Dec 09, 2013 5:37 pm

Re: 12157 Tariff Plan Why WA? Please, help me

Post by zipu_sub » Mon Dec 09, 2013 9:40 pm

why my code still wa.......plese help me

User avatar
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: 12157 Tariff Plan Why WA? Please, help me

Post by uDebug » Sat Dec 21, 2013 8:03 am

zipu_sub wrote:why my code still wa.......plese help me
Post your code so we can have a look at it.
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

sady
New poster
Posts: 17
Joined: Sat Dec 07, 2013 8:00 am

12157 Tariff Plan Why WA? Please, help me

Post by sady » Sat Dec 28, 2013 6:21 pm

i'm getting PE . :cry:

User avatar
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: 12157 Tariff Plan Why WA? Please, help me

Post by uDebug » Sat Dec 28, 2013 6:39 pm

sady wrote:i'm getting PE . :cry:
Post your code so that it can be reviewed. You're nearly there if you have a PE.
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

xrenon
New poster
Posts: 10
Joined: Tue Sep 23, 2014 4:11 am

Re: 12157 - Tariff Plan

Post by xrenon » Sat Oct 11, 2014 6:34 pm

DELETED
Last edited by xrenon on Wed Oct 15, 2014 1:10 pm, edited 2 times in total.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 12157 - Tariff Plan

Post by brianfry713 » Mon Oct 13, 2014 10:06 pm

Input:

Code: Select all

1
1
1905
Output should be:

Code: Select all

Case 1: Juice 480
Check input and AC output for thousands of problems on uDebug!

Post Reply

Return to “Volume 121 (12100-12199)”