### PARTHO_DAS's blog

By PARTHO_DAS, history, 3 months ago,
I am trying to solve [E. Little Elephant and Inversions](https://codeforces.com/contest/220/problem/E)
But in the third test case :
7 3
1 7 6 4 9 5 3
The expected output is: 6
But I can't understand how it's possible, in my logic I find the answer is: 15

7 3
1 7 6 4 9 5 3
-------------
0 1 2 3 4 5 6 // i
I find :
5 3       || l = 5, r = 6
9 5 3     || l = 4, r = 6
9 5       || l = 4, r = 5
4 9 5     || l = 3, r = 5
4 9       || l = 3, r = 4
6 4 9 5   || l = 2, r = 5
6 4 9     || l = 2, r = 4
6 4       || l = 2, r = 3
7 6 4 9   || l = 1, r = 4
7 6 4     || l = 1, 4 = 3
7 6       || l = 1, r = 2
1 7 6 4 9 || l = 0, r = 4
1 7 6 4   || l = 0, r = 3
1 7 6     || l = 0, r = 2
1 7       || l = 0, r = 1
----------------------------
15 unique l and r, where inversions count is less than or equal to 3.

[My submission](https://codeforces.com/contest/220/submission/96186615)


• +2

By PARTHO_DAS, history, 15 months ago,

I am a noob programmer but my I accepted a problem in CF global round 5. But in the main test got no verdict at that problem then I clicked on my profile submission and I saw runtime error in case no: 1 how this is possible? It comes runtime error in CF in the main test case 1 but in but pretest it was fine in pre-test. it also works fine in ideone. problem link https://codeforces.com/contest/1237/problem/B?statementsLocale=en my solution. https://ideone.com/prrXp7