Comments

Or... name yours (unofficial)

+1

+2

skob

Thanks for the analysis. I got similar results. I also made an iterative version and it was much faster than the recursive one.

A question regarding the generator part, suppose I ran an in-order traversal on a perfect binary tree using this technique:

std::generator<Node*> traverse(Node* n) {
    if (n) {
        if(n -> left) {
            co_yield std::ranges::elements_of(traverse(n -> left));;
        } 
         
        co_yield n;

        if(n -> right) {
            co_yield std::ranges::elements_of(traverse(n -> right));;
        } 
    }
}

Ignore the bugs if any.

Suppose the tree consisted of n vertices would the traversal be O(n) or O(n log n) given that each vertex v would need to propagate through depth(v) calls to reach the first call to "traverse".

On pwnedCodeforces Round 987 (Div. 2), 22 months ago
+3

As a unique problem idea-er, W round.

On carcinisationIOI 2024 Teams, 2 years ago
-9

bluds are not trynna get their country stolen too :skull:

Massive

your rating is beautiful ignore the haters

template <typename T>
using oms = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

template <typename T>
class ordered_multiset : public oms<T> {
   public:
    oms<T>::iterator find(T k) {
        auto ret = this->upper_bound(k);
        return ret != this->end() and *ret == k ? ret : this->end();
    }
    void erase(T k) {  // erases first entity of key = k
        auto it = this->find(k);
        if(it != this->end() and *it == k) this->erase(it);
    }
};

I'm not sure but something like this maybe

I think erase(T k) could give runtime error if the value isn't found, maybe replace find with upper_bound (because upper and lower bound get swapped with less_equal) and check if the value is equal to k before calling the erase(U it) inside erase(T k)

Yet, every year, the Egyptian informatics teams make blogs asking for funding because their own people wont even give them the (relatively insignificant) amount of money needed to participate in IOI, EGOI, etc.

On Syrianext op??, 4 years ago
+6

gg

On Syrianext op??, 4 years ago
0

Auto comment: topic has been updated by Syrian (previous revision, new revision, compare).

On IHatePaiuConvex Hull Trick story, 4 years ago
+13

Top tier erotica. nutted twice

Don't save the inversions in a vector, that just uses extra time and memory. Try instead to apply the increments to the dp array directly, and in the end just loop over the array again and find the inversions instead of using the vector (a)

Familysexsimulator_v2 (didn't officially drop yet)

-15

So much for ur unaffected contribution

-57

while ur at it, make an extension to hide his gay ass pfp. like goddamn that shit makes me wanna bussss

exceeding stack limit can cause mle and rte, also the memory accessed in recursion is not clustered as in iterative so i think that adds to the time

Which problem?

On HudayarLet's grow!, 5 years ago
0

I pull uuuupp

screaming that probably needs permission, its not even permitted in islam because it could possibly bother the surrounding people. does it make u happy to make anonymous accounts and look ignorant, or do u show these comments to someone seeking their approval cuz its real sad either way <3

nobody is telling u what u can and can't do. ig u can say were teaching u the manners which muslims learn at the age of 6.

orrrrrrr you can go and solve some problems and focus on getting better at cp since ur just wasting ur time and offending other people at the same time. time to grow up g

notice how u just attacked our religion in the worst possible way and all the muslim commenters replied with respect. u can learn a thing or two from us. allah yahdeek

bols

+16

<3

On Hussien_Ibrahiemcodeforces is slow, 5 years ago
-21

why are downvote? am agree!!

On Hussien_Ibrahiemcodeforces is slow, 5 years ago
-65

hot damn so tru

oh, my B didn't notice that. you're a real G

for problem C it never specifically stated that pair cant be repeated, doesnt that mean the i can use that as a test case in hacks?

hmm yes so u must have a mega long template, get kong'd