| № | Пользователь | Рейтинг |
|---|---|---|
| 1 | Benq | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | turmax | 3559 |
| 6 | tourist | 3541 |
| 7 | strapple | 3515 |
| 8 | ksun48 | 3461 |
| 9 | dXqwq | 3436 |
| 10 | Otomachi_Una | 3413 |
| Страны | Города | Организации | Всё → |
| № | Пользователь | Вклад |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | adamant | 153 |
| 3 | Um_nik | 147 |
| 4 | Proof_by_QED | 146 |
| 5 | Dominater069 | 145 |
| 6 | errorgorn | 142 |
| 7 | cry | 139 |
| 8 | YuukiS | 135 |
| 9 | TheScrasse | 134 |
| 10 | chromate00 | 133 |
|
0
problem c edge case: n=6 k=1 2 2 3 3 4 4 ans= 3; wrong solution : if you do lower_bound on a[i]+k it make skip some answer; right solution : two pointer i=0, j=n/2; while(i<n/2&&j<n) You can always upvote to appriciate thanks; |
|
0
Auto comment: topic has been updated by sparcyoto (previous revision, new revision, compare). |
|
0
If first is the case then we can divide and conquer to split the array where 1,2 and 2,1 occur and send left and right part in recursion and after all splitting at leaf of recursive, left with array of size 1 or more, if size >1 then remove in such a way so 1 and 2 on both face of array is removed. This work in O(n*logn). And at first remove all even occurrance of 1 and 2 from array.Then process. |
|
0
Can we remove both of the position or one of them at a time. if 2nd is the case then we know 3^n is total case and we can remove those array which have only 1 and 2 that is 2^n-3 so answer is (3^n-(2^n-3)). We remove 3 i.e 1 for empty array, 1 for array with only 1 and 1 for array with only 2. |
|
0
Auto comment: topic has been updated by sparcyoto (previous revision, new revision, compare). |
| Название |
|---|


