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 1138. Integer Percentage

Can anybody give me a hint or test or something, why it does not work?. Here's my code
Posted by Osama Ben Laden 7 Mar 2002 19:58
#include <fstream.h>

int a[10002];
int n,s,i;
int main()
{
 cin>>n>>s; a[n]=1;
 for(i=n-1; i>=s; i--)
 {
  int m=0;
  for(int j=1; j<=n-i; j++)
   if(100*j%i == 0)
   if(a[j+i]>m) m = a[j+i];
  a[i] = m + 1;
 }
 int max = 0;
 for(i=n; i>=s; i--)
   if(a[i]>max) max = a[i];
 cout<<max;
 return 0;
}