## 382 - Perfection

Moderator: Board moderators

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

### Re: 382 - Perfection getting WA

Read the problem statement and look at the sample output, there are two spaces after each number.
Post your updated code if you still want help. Also use the code blocks when posting code.
Check input and AC output for thousands of problems on uDebug!

NAbdulla
New poster
Posts: 31
Joined: Wed Jul 30, 2014 3:40 pm
Contact:

### Re: 382 - Perfection getting WA

Thanks a lot, Accepted after using two spaces .

mhsn06
New poster
Posts: 16
Joined: Tue Apr 01, 2014 7:36 pm

### Re: 382 - Perfection

1 < N < 100
So input 1 is invalid. Moreover, how can 1 be deficient?
1 = 1*1 *1 *1 *1......
1> summation of it product

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

### Re: 382 - Perfection

1 does appear in the judge's input and in order to get AC you need to print deficient.
Check input and AC output for thousands of problems on uDebug!

liya
New poster
Posts: 10
Joined: Fri Jan 23, 2015 2:36 pm

### Re: 382 - Perfection

presentation error:

Code: Select all

``````#include<stdio.h>
int main()
{
long long int i,n,j,count=0;
for( ; ; )
{
long long int sum=0;
scanf("%lld",&n);
if(n==0)
{
printf("END OF OUTPUT\n");
break;
}
if(count!=1)
{
printf("PERFECTION OUTPUT\n");

}
count=1;

for(i=1;i<=n/2;i++)
{
if(n%i==0)
{
sum=sum+i;
}
}
if(sum==n)
{
printf("%lld  PERFECT\n",n);
}
else if(sum>n)
{
printf("%lld  ABUNDANT\n",n);
}
else if(sum<n)
{
printf("%lld  DEFICIENT\n",n);
}

}
return 0;
}``````
Last edited by brianfry713 on Fri Feb 06, 2015 10:36 pm, edited 1 time in total.