11777 - Automate the Grades

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

Moderator: Board moderators

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

Re: 11777 - Automate the Grades Why getting WA???

Post by brianfry713 » Tue Sep 17, 2013 9:55 pm

Try running your code on the sample input. It looks like you mixed N and n.
Check input and AC output for thousands of problems on uDebug!

KaziInzamamMahmud
New poster
Posts: 9
Joined: Sun Jul 21, 2013 2:34 pm

Re: 11777 - Automate the Grades Why getting WA???

Post by KaziInzamamMahmud » Thu Sep 19, 2013 5:38 pm

Thanks Brian......Got Accepted
But while doing cin<<n; [wrong]....it also shows correct output !!!!!!!!!

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

Re: 11777 - Automate the Grades Why getting WA???

Post by uDebug » Wed Feb 19, 2014 3:09 pm

Here's some input / output that was useful during testing / debugging.

Input:

Code: Select all

14
15 18 25 8 15 17 12
20 20 30 10 20 20 20
20 20 30 10 18 0 0 
19 19 19 1 18 16 19
11 11 10 4 20 20 0
11 20 10 4 16 20 17
20 20 20 10 0 0 0
20 20 20 9 0 0 0
20 20 20 10 15 16 17
9 20 9 5 15 17 16
13 20 20 2 16 15 17
17 19 18 4 16 17 15
15 5 20 10 17 15 16
2 20 20 10 17 16 15
AC Output:

Code: Select all

Case 1: B
Case 2: A
Case 3: B
Case 4: C
Case 5: F
Case 6: D
Case 7: C
Case 8: D
Case 9: B
Case 10: F
Case 11: C
Case 12: C
Case 13: D
Case 14: D
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

mpmohi
New poster
Posts: 13
Joined: Wed Feb 26, 2014 10:15 pm

11777 What's wrong with it ?!?

Post by mpmohi » Wed Feb 26, 2014 10:47 pm

I've submitted this code for the problem 11777....and continuously getting WA!! :(
this is my code though it is simple.... :P

Code: Select all

while(Accepted)

    return Happy;

Last edited by mpmohi on Sat Nov 22, 2014 10:51 pm, edited 1 time in total.

mpmohi
New poster
Posts: 13
Joined: Wed Feb 26, 2014 10:15 pm

Re: 11777 - Automate the Grades Why getting WA???

Post by mpmohi » Wed Feb 26, 2014 11:00 pm

It's getting a WA! though it passes the given debug test above.. :cry:


Code: Select all

    while(Accepted)

        return Happy;



Last edited by mpmohi on Sat Nov 22, 2014 10:53 pm, edited 1 time in total.

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

Re: 11777 What's wrong with it ?!?

Post by brianfry713 » Thu Feb 27, 2014 2:18 am

Input:

Code: Select all

1
20 20 30 10 0 10 10
AC output:

Code: Select all

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

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

Re: 11777 - Automate the Grades Why getting WA???

Post by brianfry713 » Thu Feb 27, 2014 2:19 am

Don't double post.
Check input and AC output for thousands of problems on uDebug!

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

Re: 11777 - Automate the Grades Why getting WA???

Post by uDebug » Thu Feb 27, 2014 7:41 am

mpmohi wrote:It's getting a WA! though it passes the given debug test above.. :cry:
Please refrain from repeating yourself.

Try the following input:

Code: Select all

1
20 20 30 10 1 15 15
AC Output:

Code: Select all

Case 1: A
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

mpmohi
New poster
Posts: 13
Joined: Wed Feb 26, 2014 10:15 pm

Re: 11777 What's wrong with it ?!?

Post by mpmohi » Fri Feb 28, 2014 8:40 pm

Yesss....accepted....thanks Binary bro.... :P

mesho
New poster
Posts: 1
Joined: Sun Mar 23, 2014 8:59 am

Re: 11777 - Automate the Grades Why getting WA???

Post by mesho » Wed Mar 26, 2014 12:39 am

iam getting WA with c++

Code: Select all

#include <iostream>
#include <algorithm>
using namespace std;
int main ()
{

	char grade ;
	int arry[10],n,avrage;
	cin >>n;
		for(int j=1;j<=n;j++){
		
		int marks=0;
		float sum=0;
		int	counter=0;
		int avrage[3];

			for  (int i=0;i<7;i++)
		{
			cin >>arry[i];

			if ( i >= 4 )
			{
				avrage [counter] = arry [i] ;
				sort(avrage,avrage+counter);
				counter++;

			}

		}
		sum= (avrage[2]+avrage[1])/2.0;
		marks =arry[0]+arry[1]+arry[2]+arry[3]+sum;
		if (marks >= 90)
		{
		
		grade = 'A';
		
		}

		else if (marks >= 80 && marks < 90)
		{
		
		grade = 'B';
		
		}
		else if (marks >= 70 && marks < 80)
		{
		
		grade = 'C';
		
		}
		else if (marks >= 60 && marks < 70)
		{
		
		grade = 'D';
		
		}
		else 
		{
		
			grade ='F';
		
		}
		
		cout << "Case " << j << ": " << grade <<endl;
		
		
	}
	}
Last edited by brianfry713 on Wed Jan 07, 2015 3:14 am, edited 1 time in total.
Reason: Added code blocks

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

Re: 11777 - Automate the Grades Why getting WA???

Post by uDebug » Wed Mar 26, 2014 7:31 am

mesho wrote:iam getting WA with c++
Use code tags to share your code.

Return a 0 at the end of your program.
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

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

Re: 11777 - Automate the Grades Why getting WA???

Post by brianfry713 » Wed Mar 26, 2014 8:31 pm

Try solving it without using floating point.
Check input and AC output for thousands of problems on uDebug!

#bdbug66
New poster
Posts: 1
Joined: Mon Jun 02, 2014 1:58 am

Re: 11777 - Automate the Grades Why getting WA???

Post by #bdbug66 » Mon Jun 02, 2014 4:47 am

getting WA. Can anyone HELP please?
Thanks in advance.

Code: Select all

got AC
Last edited by #bdbug66 on Sun Jun 15, 2014 6:53 pm, edited 1 time in total.

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

Re: 11777 - Automate the Grades Why getting WA???

Post by uDebug » Mon Jun 02, 2014 7:02 am

#bdbug66 wrote:getting WA. Can anyone HELP please?
Your code doesn't produce output that matches the sample output. You need to make sure your code does at least that - right?

Also, please take the time to read the thread carefully and test your code with the test cases you'll typically find. The thread exists (and people take the time to reply) for a reason.
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

lighted
Guru
Posts: 585
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 11777 - Automate the Grades Why getting WA???

Post by lighted » Sun Jul 27, 2014 1:42 am

brianfry713 wrote:You're not printing the case number correctly if they get an F.
The letter grades are given based on the total marks obtained by a student and is shown below:

· A >= 90%

· B >= 80% & < 90%

· C >= 70% & < 80%

· D >= 60% & < 70%

· F < 60%
Strange school which doesn't have grade E, while has D and F. :roll:
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman

Post Reply

Return to “Volume 117 (11700-11799)”