ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1157. Young Tiler

Can Anyone Identify The Mistake
Posted by K P Charith Chowdary 27 Nov 2007 20:19
#include<stdio.h>

int val(int n)
{
    int i,count=0;
    if(n<=0)
    return n;
    else
    {
    for(i=1;i<=(int)sqrt(n);i++)
    {
       if(n%i==0)
       count++;
    }
    return count;
    }
}

int main()
{
    int flag,m,n,k,i;
    flag=0;
    scanf("%d %d %d",&m,&n,&k);
    for(i=1;i<=10000;i++)
    {
        if(val(i)==n&&val(i-k)==m)
        {
             flag=1;
             break;
        }
    }
    if(flag==1)
    printf("%d",i);
    else
    printf("0");
    //system("pause");
    return 0;
}


I am Getting Wrong Answer For Test Case 1 Itself

But i am getting the right answer 16 For The Input Cases
Re: Can Anyone Identify The Mistake
Posted by Smilodon_am [Obninsk INPE] 13 Apr 2011 14:22
Try the following test. It has helped me.
1 3 1
Right answer is
12