trees, fix toposort

This commit is contained in:
Benjamin Qi 2020-07-19 11:43:50 -04:00
parent 4c122416c1
commit e351215b68
3 changed files with 7 additions and 6 deletions

View file

@ -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"),
],
}
}

View file

@ -155,9 +155,9 @@ Note that the implementation of this idea below uses Kahn's algorithm for topolo
<LanguageSection>
<CppSection>
```cpp
#include <bits/stdc++.h>
```cpp
#include <bits/stdc++.h>
using namespace std;
@ -259,8 +259,8 @@ int main() { //See "Intro - Fast I/O" for more information about the first two l
</CppSection>
<JavaSection>
```java
```java
import java.util.*;
import java.io.*;

View file

@ -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"], ""),