382 - Perfection

All about problems in Volume 3. 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: 382 - Perfection getting WA

Post by brianfry713 » Fri Aug 01, 2014 7:31 pm

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: 30
Joined: Wed Jul 30, 2014 3:40 pm
Contact:

Re: 382 - Perfection getting WA

Post by NAbdulla » Fri Aug 01, 2014 7:42 pm

Thanks a lot, Accepted after using two spaces :) .

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

Re: 382 - Perfection

Post by mhsn06 » Tue Sep 30, 2014 10:10 am

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
:D

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

Re: 382 - Perfection

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

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

Post by liya » Fri Feb 06, 2015 3:51 pm

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.
Reason: Added code blocks

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

Re: 382 - Perfection

Post by brianfry713 » Fri Feb 06, 2015 11:05 pm

Format counts: the echoed integers should be right justified within the first 5 spaces of the output line, followed by two blank spaces, followed by the description of the integer.
Check input and AC output for thousands of problems on uDebug!

Post Reply

Return to “Volume 3 (300-399)”