Page 4 of 7

382 WA...

Posted: Tue Aug 01, 2006 1:17 am
by bongssi
I checked 1 is deficient. I don't know why I got WA. Plz help me~!
Here is my code.

The code is deleted after AC.

382 An easy problem!

Posted: Tue Aug 01, 2006 1:42 pm
by linux
You've done a mistake according to judges output.
in your code after printf
END OF OUTPUT
not END_OF_OUTPUT!
I think it's why you are getting wrong answer from the particular problem.
Also you'll get presentation error for

Code: Select all

printf("%5d ", number);
But you should print

Code: Select all

printf("%5d  ", number);
means two spaces after right justification.

Oh, thank you very much!

Posted: Wed Aug 02, 2006 10:35 am
by bongssi
I noticed I commit a stupid mistake. I modified my source and got AC for this problem. Thank you very much :)

382 WA

Posted: Tue Nov 14, 2006 4:17 pm
by hf_1992
Del after AC

Posted: Tue Nov 14, 2006 5:00 pm
by helloneo
there are a lot of threads on this problem..
search first..
if you need to post, use old one to post..

Why Presentation Error on 382???

Posted: Thu Dec 21, 2006 5:26 pm
by Oronno
I have solve it and check it that it works with correct output format.
after submitting, i get PE.
But i sure, i do it as it say in sample output format.
I am afraid on ACM!!! :roll:


Code: Select all

Code has removed

Posted: Thu Dec 21, 2006 6:49 pm
by joy
print a new line after "END OF OUTPUT" that is...
printf("END OF OUTPUT\n");

Dont open a new thread if there is one already. If there is no thread then open a new one.
remove your code after AC

382,wrong answer

Posted: Sun Apr 29, 2007 6:09 pm
by rana_cse_ruet
I can't guess why the following code is getting WA. Can anyone help me out, plz... ??

Code: Select all

#include<iostream.h>
#include<iomanip.h>

#include<stdio.h>

void main()
{
	 
	long int i;
	long int x,sum;

	cout<<"PERFECTION OUTPUT\n";
	while(cin>>x&&x)
	{
		 
		sum=1;
		for(i=2;i<=x/2;i++)
		{
			if(x%i==0)
			{
			 sum+=i;
			}

		}
		 
		if(sum==x)
			cout<<setw(5)<<x<<"  PERFECT\n";
		else if(sum<x)
			cout<<setw(5)<<x<<"  DEFICIENT\n";
		else 
			cout<<setw(5)<<x<<"  ABUNDANT\n";
	}
	cout<<"END OF OUTPUT";
	 
}

Posted: Sun Apr 29, 2007 7:16 pm
by Jan
Don't open a new thread if there is one already.

I need help too...

Posted: Fri Dec 07, 2007 11:47 pm
by scott1991
I was wondering why mine is wrong...It gives me all the correct answers but gives wa when submitted.

Code: Select all

AC Now!!
thanks for any help.

[Edited by Jan. pls use code tags]

Posted: Sun Dec 09, 2007 8:29 pm
by Jan
Increase the size of your array.

Posted: Thu Dec 13, 2007 9:12 pm
by scott1991
done that but still get wa...any other ideas? Cheers.

Code now:

Code: Select all

Ac now!!

Posted: Fri Dec 21, 2007 7:19 pm
by Jolanda
I got RE on my code, why???

Code:
import java.io.*;
import java.util.*;

public class Main {
public static void main(String[] args) throws IOException {
BufferedReader vhod = new BufferedReader(new InputStreamReader(System.in));
int[] tab = new int[100];
int k = 0;

String line = vhod.readLine();
StringTokenizer num = new StringTokenizer(line, " ");
while (true) {
int a = Integer.parseInt(num.nextToken());
if (a == 0) break;
tab[k++] = a;
}

int[] rez = solve(tab);

System.out.println();
System.out.println("PERFECTION OUTPUT");
for (int i = 0; i < k; i++) {
int d = (Integer.toString(tab)).length();
if (d == 1) System.out.print(" ");
if (d == 2) System.out.print(" ");
if (d == 3) System.out.print(" ");
if (d == 4) System.out.print(" ");
System.out.print(tab + " ");
if (rez == 0) System.out.println("PERFECT");
if (rez == -1) System.out.println("DEFICIENT");
if (rez == 1) System.out.println("ABUNDANT");
}
System.out.println("END OF OUTPUT");
}


public static int[] solve(int[] tab) {
int n = tab.length;
int[] rez = new int[n];
for (int i = 0; i < n; i++) {
int d = sum(tab);
if (d < tab) rez = -1;
if (d > tab) rez = 1;
}
return rez;
}


public static int sum(int a) {
int v = 1;
for (int i = 2; i < a; i++) {
if (a%i == 0) v += i;
}
return v;
}
}

Why i got RE..

Posted: Mon Mar 03, 2008 8:59 am
by Obaida
Some one please help me I got RE.....

Code: Select all

Removed
[code]

Posted: Mon Mar 03, 2008 3:46 pm
by CSEDU_1323
if n==1 then it is deficient

&&

in D input() scanf(); use %ld instead %d

HOPE THIS HELP