|
|
вернуться в форумCan anybody give me a hint or test or something, why it does not work?. Here's my code #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; } |
|
|