You are not logged in. Please login at www.codechef.com to post your questions!

×

explaination needed Maxpr !!

PROBLEM : MAXPR

I tried it using the editorial's method but getting TLE...

And also the tester's & setter's solution uses some other method... No explaination for this method is given in editorial...

I want to know how does below algo works ? what does cnt[][] stands for? reply asap

tester's solution :TESTER'S sol

   ans = n + 1;
   for(i =0;i<n;i++){
    scanf("%d",&x);
    AIN(1,x,100);
    for(j = 0;j<=100;j++){
        cnt[x][x-j+100]+=cnt[j][x - j+100];
        cnt[x][x-j+100]%=MOD;
    }
    for(j = -100;j<=100;j++){
        cnt[x][j + 100]++;
        cnt[x][j+100]%=MOD;
        ans --;
    }
}
This question is marked "community wiki".

asked 25 Jul '14, 16:18

grayhathacker's gravatar image

5★grayhathacker
3374514
accept rate: 0%

edited 07 Jan '15, 17:13

admin's gravatar image

0★admin ♦♦
19.8k350498541

anyone ???

(25 Jul '14, 21:48) grayhathacker5★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×2,167
×20

question asked: 25 Jul '14, 16:18

question was seen: 565 times

last updated: 07 Jan '15, 17:13