From 8e13ead61437329c1ed31a8d45e36e5a871e89e7 Mon Sep 17 00:00:00 2001 From: Benjamin Qi Date: Wed, 24 Jun 2020 13:49:20 -0400 Subject: [PATCH] clean up BIT --- content/5_Gold/{PURS.mdx.md => PURS.md} | 35 ++++++++++++------------- src/components/markdown/Problems.tsx | 9 +++++++ 2 files changed, 26 insertions(+), 18 deletions(-) rename content/5_Gold/{PURS.mdx.md => PURS.md} (72%) diff --git a/content/5_Gold/PURS.mdx.md b/content/5_Gold/PURS.md similarity index 72% rename from content/5_Gold/PURS.mdx.md rename to content/5_Gold/PURS.md index 6af3e69..a543e55 100644 --- a/content/5_Gold/PURS.mdx.md +++ b/content/5_Gold/PURS.md @@ -22,7 +22,7 @@ Aka *Fenwick Tree*. ### Sample Problems - + Can also do range XOR queries w/ update. @@ -85,22 +85,22 @@ Note that if it were not the case that all elements of the input array were dist - CSES - + easy with indexed set - + easy with indexed set - + not harder than point update range query - + - + - + - + @@ -126,17 +126,16 @@ Note that if it were not the case that all elements of the input array were dist - + - + also just inversion counting - - * [Out of Sorts (USACO Silver)](http://usaco.org/index.php?page=viewproblem2&cpid=834) - * aka [Sorting Steps](https://csacademy.com/contest/round-42/task/sorting-steps/) [](42) - * Of course, this doesn't require anything other than sorting but fast range sum queries may make this easier. - + + - aka [Sorting Steps](https://csacademy.com/contest/round-42/task/sorting-steps/) [](42) + - Of course, this doesn't require anything other than sorting but fast range sum queries may make this easier. + + + Offline 2D queries can be done with a 1D data structure + - - * [Twin Permutations](https://www.hackerearth.com/practice/data-structures/advanced-data-structures/fenwick-binary-indexed-trees/practice-problems/algorithm/mancunian-and-twin-permutations-d988930c/description/) - * Offline 2D queries can be done with a 1D data structure \ No newline at end of file diff --git a/src/components/markdown/Problems.tsx b/src/components/markdown/Problems.tsx index dc8267e..1690fc1 100644 --- a/src/components/markdown/Problems.tsx +++ b/src/components/markdown/Problems.tsx @@ -41,6 +41,8 @@ type ProblemComponentProps = { name?: string; url?: string; cses?: string; + kattis?: string; + usaco?: string; starred?: boolean; difficulty?: 'Intro' | 'Easy' | 'Normal' | 'Hard' | 'Very Hard'; notes?: React.ReactNode; @@ -60,6 +62,13 @@ export function ProblemComponent(props: ProblemComponentProps) { if (props.cses) { url = 'https://cses.fi/problemset/task/' + props.cses; } + if (props.kattis) { + url = 'https://open.kattis.com/problems/' + props.kattis; + } + if (props.usaco) { + url = + 'http://www.usaco.org/index.php?page=viewproblem2&cpid=' + props.usaco; + } return (