Page 1 of 1

12157 - Tariff Plan

Posted: Sun Jan 01, 2012 4:35 pm
by uvasarker
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;
}


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

Posted: Mon Jan 02, 2012 8:02 pm
by leobonalume
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

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

Posted: Wed Jan 04, 2012 9:32 am
by uvasarker
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

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

Posted: Thu Jan 05, 2012 1:29 pm
by leobonalume
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

12157

Posted: Fri Sep 28, 2012 4:36 pm
by sumaiyyah
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;
}
	

Re: 12157

Posted: Fri Sep 28, 2012 8:33 pm
by brianfry713
Doesn't match the sample I/O.

Re: 12157

Posted: Sat Sep 29, 2012 3:02 pm
by sumaiyyah
brianfry713 wrote:Doesn't match the sample I/O.
i solved it. :D

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

Posted: Mon Dec 09, 2013 9:40 pm
by zipu_sub
why my code still wa.......plese help me

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

Posted: Sat Dec 21, 2013 8:03 am
by uDebug
zipu_sub wrote:why my code still wa.......plese help me
Post your code so we can have a look at it.

12157 Tariff Plan Why WA? Please, help me

Posted: Sat Dec 28, 2013 6:21 pm
by sady
i'm getting PE . :cry:

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

Posted: Sat Dec 28, 2013 6:39 pm
by uDebug
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.

Re: 12157 - Tariff Plan

Posted: Sat Oct 11, 2014 6:34 pm
by xrenon
DELETED

Re: 12157 - Tariff Plan

Posted: Mon Oct 13, 2014 10:06 pm
by brianfry713
Input:

Code: Select all

1
1
1905
Output should be:

Code: Select all

Case 1: Juice 480