| # | User | Rating |
|---|---|---|
| 1 | Kevin114514 | 3722 |
| 2 | Benq | 3676 |
| 3 | jiangly | 3640 |
| 4 | turmax | 3450 |
| 5 | tourist | 3408 |
| 6 | strapple | 3360 |
| 7 | Um_nik | 3354 |
| 8 | squareOf105 | 3348 |
| 9 | maroonrk | 3196 |
| 10 | idontwannadothis…e | 3191 |
| # | User | Contrib. |
|---|---|---|
| 1 | maroonrk | 153 |
| 2 | Qingyu | 152 |
| 3 | nik_exists | 151 |
| 4 | AmShZ | 147 |
| 4 | maspy | 147 |
| 6 | Um_nik | 142 |
| 7 | Errichto | 139 |
| 8 | adamant | 136 |
| 9 | BledDest | 134 |
| 10 | AksLolCoding | 132 |
|
0
CODE ``` class Solution { public: long long getCount(int n, vector &arr, int a, int b) { long long ans = 0; multiset<int> st;
for (int i = 0, j = 0; j < n; j++) {
st.insert(arr[j]);
while (j - i + 1 > 1) {
int x = *st.begin() + *(++st.begin());
int y = *st.rbegin() + *(++st.rbegin());
if (x >= a && y <= b)
break;
st.erase(st.find(arr[i]));
i++;
}
ans += j - i + 1;
}
return ans;} };``` |
|
0
use multiset to find 2 max and 2 min elements in a sliding window. |
|
On
Pols_Agyi_Pols →
Invitation to CodeChef Starters 145(Rated till 6-Stars) — 31st July, 2 years ago
-8
cry more kid... and what's his main point? He is clearly trying to defend the cheaters in the name of numbers. |
|
On
Pols_Agyi_Pols →
Invitation to CodeChef Starters 145(Rated till 6-Stars) — 31st July, 2 years ago
0
bokunopicolo Leave buddy Just ignore his comments. These people will always find a reason to get the argument going and never accept the facts which are against India. |
|
On
Pols_Agyi_Pols →
Invitation to CodeChef Starters 145(Rated till 6-Stars) — 31st July, 2 years ago
-11
there is a huge difference between "lots of math rounds" and "every round is a math round". Stop defending India just because you're Indian. As an Indian, we should accept the negative points of our country and try to work on them, instead of just arguing and trying to prove the facts wrong. |
|
On
Pols_Agyi_Pols →
Invitation to CodeChef Starters 145(Rated till 6-Stars) — 31st July, 2 years ago
-9
I'm an Indian and i totally agree. The problems are always inclined towards Math and constructive algos. And cheaters? yeah a lot. India is the hub of cheaters. |
|
0
didn't get your point. What's the use of cycle lengths?? And, anyways finding all cycles is i guess NP |
|
0
Thanks, I'll read about block-cut tree and will try to implement. |
|
0
I did the exact same thing. But if fails on the following graph.
6 and 5 will always lie in 2 different branches of the tree, but they have to be in the same. (or maybe I'm wrong about the decomposition, if so can you please mention some resource?, I've encountered this type of problem, a number of times) |
|
0
thanks for mentioning but this is not what I'm looking for |
|
0
|
| Name |
|---|


