From 3e9398c0baa50e5f5017d413298e9edcb9c69fc8 Mon Sep 17 00:00:00 2001 From: thatisnotobvio <83133702+thatisnotobvio@users.noreply.github.com> Date: Sun, 3 Oct 2021 04:12:31 +0530 Subject: [PATCH] Random changes --- README.md | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 72004de..a00c564 100644 --- a/README.md +++ b/README.md @@ -13,39 +13,52 @@ https://math.stackexchange.com/questions/2956889/how-many-number-of-integer-coordinates-exists-between-a-line-segment-including -no of trees with n labeled vertices is n^(n-2) https://en.wikipedia.org/wiki/Cayley%27s_formula +Number of trees with n labeled vertices = n^(n-2) . + Link - (https://en.wikipedia.org/wiki/Cayley%27s_formula) https://proofwiki.org/wiki/Sum_of_r%2Bk_Choose_k_up_to_n -Smallest Enclosing Circle https://codeforces.com/blog/entry/23554 +Smallest Enclosing Circle. Link - ( https://codeforces.com/blog/entry/23554 ) a+b=a⊕b+2×(a and b)=(a or b)+(a and b) -Dilworth's theorem states that, in any finite partially ordered set, the largest antichain has the same size as the smallest chain decomposition +Dilworth's theorem states that, in any finite partially ordered set, the largest antichain has the same size as the smallest chain decomposition. -Set bits xor pairsum https://atcoder.jp/contests/abc091/submissions/11263481 +Set bits xor pairsum . Link - ( https://atcoder.jp/contests/abc091/submissions/11263481 ) Policy Based data structure + OrderedSet (Use as multiset) + #include // Common file -#include // Including tree_order_statistics_node_updat + +#include // Including tree_order_statistics_node_update + using namespace __gnu_pbds; + typedef tree, rb_tree_tag, tree_order_statistics_node_update> ordered_set; order_of_key -> find element less than x + find_order_by -> returns iterator to kth largest element counting from 0. + lower bound works as upper bound + Normal set + typedef tree, rb_tree_tag, tree_order_statistics_node_update> ordered_set; Fast Hash in cpp const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count(); + struct chash { int operator()(int x) const { return x ^ RANDOM; }}; + cc_hash_table> cnt; +