From e351215b68e4836f2e5dea85aceae6f8de1007f8 Mon Sep 17 00:00:00 2001 From: Benjamin Qi Date: Sun, 19 Jul 2020 11:43:50 -0400 Subject: [PATCH] trees, fix toposort --- content/4_Gold/DP_Trees.mdx | 1 + content/4_Gold/TopoSort.mdx | 10 +++++----- content/5_Plat/Centroid.mdx | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/content/4_Gold/DP_Trees.mdx b/content/4_Gold/DP_Trees.mdx index 32f65db..c4aa8e3 100644 --- a/content/4_Gold/DP_Trees.mdx +++ b/content/4_Gold/DP_Trees.mdx @@ -27,6 +27,7 @@ export const metadata = { new Problem("Plat", "Delegation", "1020", "Hard", false, ["DP", "Binary Search"], ""), new Problem("CF", "Ostap & Tree", "problemset/problem/735/E", "Hard", false, ["DP"], "$O(NK)$ I think"), new Problem("CSES", "Creating Offices", "1752", "Hard", false, ["Greedy"], "equivalent to BOI - Cat in a Tree"), + new Problem("Plat", "Cow At Large", "793", "Hard", false, [], "This is not too hard to fakesolve. First write an (optimized?) O(N^2) DP to pass test cases 1-6. This won't work for test cases 7-11, but in these test cases all trees have at most 20 leaves. Therefore it suffices to compress tree edges (repeatedly remove vertices of degree 2) and run the same solution. For a legit DP solution, see Eric Zhang's comment here: https://codeforces.com/blog/entry/57170?#comment-410179"), ], } } diff --git a/content/4_Gold/TopoSort.mdx b/content/4_Gold/TopoSort.mdx index 83e2908..4621229 100644 --- a/content/4_Gold/TopoSort.mdx +++ b/content/4_Gold/TopoSort.mdx @@ -155,9 +155,9 @@ Note that the implementation of this idea below uses Kahn's algorithm for topolo - - ```cpp - #include + +```cpp +#include using namespace std; @@ -259,8 +259,8 @@ int main() { //See "Intro - Fast I/O" for more information about the first two l - - ```java + +```java import java.util.*; import java.io.*; diff --git a/content/5_Plat/Centroid.mdx b/content/5_Plat/Centroid.mdx index b15107f..d4cf8d6 100644 --- a/content/5_Plat/Centroid.mdx +++ b/content/5_Plat/Centroid.mdx @@ -19,7 +19,7 @@ export const metadata = { new Problem("CF", "Digit Tree", "contest/715/problem/C", "Normal", false, ["Centroid", "NT"], ""), new Problem("CF", "Double Tree", "contest/1140/problem/G", "Normal", false, ["Centroid", "DP"], ""), new Problem("ojuz", "JOI - Factories", "JOI14_factories", "Normal", false, ["Centroid"], ""), - new Problem("CF", "Sum of Prefix Sums", contest/1303/problem/G", "Hard", false, ["Centroid", "CHT"], ""), + new Problem("CF", "Sum of Prefix Sums", "contest/1303/problem/G", "Hard", false, ["Centroid", "CHT"], ""), new Problem("YS", "Frequency Table of Tree Distance", "frequency_table_of_tree_distance", "Hard", false, ["Centroid", "FFT"], ""), new Problem("DMOJ", "Bob Equilibrium", "dmopc19c7p6", "Hard", false, ["Centroid"], "tight time limit"), new Problem("DMOJ", "Time Traveller Imaxblue", "tc19summerh", "Hard", false, ["Centroid"], ""),