摘要:MatrixTime Limit:3000MSMemory Limit:65536KTotal Submissions:17226Accepted:6461DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i,...
阅读全文
摘要:MatrixTime Limit:3000MSMemory Limit:65536KTotal Submissions:17224Accepted:6460DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i,...
阅读全文
摘要:CatenymsTime Limit:1000MSMemory Limit:65536KTotal Submissions:8756Accepted:2306DescriptionA catenym is a pair of words separated by a period such that the last letter of the first word is the same as the last letter of the second. For example, the following are catenyms:dog.gophergopher.ratrat.tiger
阅读全文
摘要:Sightseeing tourTime Limit:1000MSMemory Limit:10000KTotal Submissions:6986Accepted:2901DescriptionThe city executive board in Lund wants to construct a sightseeing tour by bus in Lund, so that tourists can see every corner of the beautiful city. They want to construct the tour so that every street i
阅读全文
摘要:TreeTime Limit:1000MSMemory Limit:30000KTotal Submissions:8554Accepted:2545DescriptionGive a tree with n vertices,each edge has a length(positive integer less than 1001).Define dist(u,v)=The min distance between node u and v.Give an integer k,for every pair (u,v) of vertices is called valid if and o
阅读全文
摘要:Balancing ActTime Limit:1000MSMemory Limit:65536KTotal Submissions:7859Accepted:3210DescriptionConsider a tree T with N (1 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 #include 15 #include 16 #include 17 #include 18 #include 19 using namespace std;20 const int MAXN = 20..
阅读全文
摘要:Musical ThemeTime Limit:1000MSMemory Limit:30000KTotal Submissions:15900Accepted:5494DescriptionA musical melody is represented as a sequence of N (1 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 #include 15 #include 16 #include 17 #include 18 #include 19 using namespace .
阅读全文
摘要:查询区间第K大,而且没有修改。使用划分树是可以做的。作为主席树的入门题,感觉太神奇了,Orz 1 /* *********************************************** 2 Author :kuangbin 3 Created Time :2013-9-4 20:13:20 4 File Name :POJ2104.cpp 5 ************************************************ */ 6 7 #include 8 #include 9 #include 10 #incl...
阅读全文
摘要:1 /* *********************************************** 2 Author :kuangbin 3 Created Time :2013-9-5 9:45:17 4 File Name :F:\2013ACM练习\专题学习\LCA\POJ1330_3.cpp 5 ************************************************ */ 6 7 #include 8 #include 9 #include 10 #include 11 #include 12 #i...
阅读全文
摘要:Closest Common AncestorsTime Limit:2000MSMemory Limit:10000KTotal Submissions:13372Accepted:4340DescriptionWrite a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The closest com
阅读全文
摘要:Closest Common AncestorsTime Limit:2000MSMemory Limit:10000KTotal Submissions:13370Accepted:4338DescriptionWrite a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The closest com
阅读全文
摘要:Nearest Common AncestorsTime Limit:1000MSMemory Limit:10000KTotal Submissions:14902Accepted:7963DescriptionA rooted tree is a well-known data structure in computer science and engineering. An example is shown below:In the figure, each node is labeled with an integer from {1, 2,...,16}. Node 8 is the
阅读全文
摘要:SuperMemoTime Limit:5000MSMemory Limit:65536KTotal Submissions:6841Accepted:2268Case Time Limit:2000MSDescriptionYour friend, Jackson is invited to a TV show called SuperMemo in which the participant is told to play a memorizing game. At first, the host tells the participant a sequence of numbers, {
阅读全文
摘要:A Simple Problem with IntegersTime Limit:5000MSMemory Limit:131072KTotal Submissions:47944Accepted:14122Case Time Limit:2000MSDescriptionYou haveNintegers,A1,A2, ... ,AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interv
阅读全文
摘要:Discrete LoggingTime Limit:5000MSMemory Limit:65536KTotal Submissions:2819Accepted:1386DescriptionGiven a prime P, 2 8 #include 9 #include 10 #include 11 #include 12 #include 13 #include 14 #include 15 #include 16 #include 17 #include 18 #include 19 using namespace std;20 //baby_step giant_step21 ..
阅读全文
摘要:TriathlonTime Limit:1000MSMemory Limit:10000KTotal Submissions:4733Accepted:1166DescriptionTriathlon is an athletic contest consisting of three consecutive sections that should be completed as fast as possible as a whole. The first section is swimming, the second section is riding bicycle and the th
阅读全文
摘要:Feng ShuiTime Limit:2000MSMemory Limit:65536KTotal Submissions:3743Accepted:1150Special JudgeDescriptionFeng shui is the ancient Chinese practice of placement and arrangement of space to achieve harmony with the environment. George has recently got interested in it, and now wants to apply it to his
阅读全文
摘要:Most Distant Point from the SeaTime Limit:5000MSMemory Limit:65536KTotal Submissions:3476Accepted:1596Special JudgeDescriptionThe main land of Japan called Honshu is an island surrounded by the sea. In such an island, it is natural to ask a question: “Where is the most distant point from the sea?” T
阅读全文
摘要:http://poj.org/problem?id=1222http://poj.org/problem?id=1830http://poj.org/problem?id=1681http://poj.org/problem?id=1753http://poj.org/problem?id=3185这几个题目都类似,都可以使用高斯消元来求解一个模2的01方程组来解决。有时候需要枚举自由变元,有的是判断存不存在解POJ 1222EXTENDED LIGHTS OUT普通的问题。肯定有唯一解。肯定枚举第一行去做,也可以使用高斯消元。 1 /* **************************.
阅读全文
摘要:TreeTime Limit:5000MSMemory Limit:131072KTotal Submissions:2825Accepted:769DescriptionYou are given a tree withNnodes. The tree’s nodes are numbered 1 throughNand its edges are numbered 1 throughN− 1. Each edge is associated with a weight. Then you are to execute a series of instructions on the tree
阅读全文