UVa

uva.onlinejudge.org

[UVa] 1103 - Ancient Messages

Problem Link: UVa 1103 - Ancient Messages Hint DFS, 數洞洞 Solution C++ #include <iostream> #include <vector> #include <algorithm> static constexpr int MAX = 200 + 2; static const int

[UVa] 572 - Oil Deposits

Problem Link: UVa 572 - Oil Deposits Hint DFS Solution C++ #include <iostream> static const int DIRECTIONS[][2] = {{-1, -1}, {0, -1}, {1, -1}, {-1, 0}, /*{0, 0},*/ {1, 0}, {-1,

[UVa] 13148 - A Giveaway

題目 Link: UVa 13148 - A Giveaway Hint 這題真的是 Giveaway... Code C++ #include <iostream> #include <vector> #include <algorithm> constexpr const int MAX = 100000000; int main() { std::vector&

[UVa] 699 - The Falling leaves

Problem Link: UVa 699 - The Falling leabes hint preorder Code C++ with array #include <iostream> bool recursion(); static constexpr const int MAX = 100; // less stack consumption static int pile[MAX]

[UVa] 839 - Not so Mobile

題目 Link: UVa 839 - Not so Mobile Code C++ #include <iostream> int recursion(); int main() { int cases; std::ios::sync_with_stdio(false); std::cin >> cases; while (cases--)

[UVa] 548 - Tree

題目 Link: UVa 548 - Tree Hint 下面兩行分別是 inorder 和 postorder 的 traversal 3 2 1 4 5 7 6 3 1 2 5 6 7 4 postorder 最後一個一定是 root inorder 中, root