随笔分类 -  ACM解题报告(POJ)

1 2 3 4 5 ··· 11 下一页

POJ题目
POJ 2155 Matrix (二维线段树)
摘要:MatrixTime Limit:3000MSMemory Limit:65536KTotal Submissions:17226Accepted:6461DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i,... 阅读全文

posted @ 2014-05-23 23:35 kuangbin 阅读(3711) 评论(0) 推荐(0) 编辑

POJ 2155 Matrix (二维树状数组)
摘要:MatrixTime Limit:3000MSMemory Limit:65536KTotal Submissions:17224Accepted:6460DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i,... 阅读全文

posted @ 2014-05-23 22:52 kuangbin 阅读(3996) 评论(1) 推荐(0) 编辑

POJ 2337 Catenyms (有向图欧拉路径,求字典序最小的解)
摘要: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 阅读全文

posted @ 2014-02-03 13:51 kuangbin 阅读(2752) 评论(0) 推荐(0) 编辑

POJ 1637 Sightseeing tour (混合图欧拉路判定)
摘要: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 阅读全文

posted @ 2014-02-03 12:41 kuangbin 阅读(3491) 评论(2) 推荐(0) 编辑

POJ 1741 Tree (树分治入门)
摘要: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 阅读全文

posted @ 2013-12-02 23:26 kuangbin 阅读(4538) 评论(5) 推荐(1) 编辑

POJ 1655 Balancing Act (求树的重心)
摘要: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.. 阅读全文

posted @ 2013-11-16 22:34 kuangbin 阅读(2772) 评论(0) 推荐(1) 编辑

POJ 1743 Musical Theme (字符串HASH+二分)
摘要: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 . 阅读全文

posted @ 2013-11-05 18:12 kuangbin 阅读(1792) 评论(0) 推荐(0) 编辑

POJ 2104 && POJ 2761 (静态区间第k大,主席树)
摘要:查询区间第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... 阅读全文

posted @ 2013-09-05 10:29 kuangbin 阅读(3769) 评论(0) 推荐(0) 编辑

POJ 1330 Nearest Common Ancestors (LCA,倍增算法,在线算法)
摘要: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... 阅读全文

posted @ 2013-09-05 10:22 kuangbin 阅读(2329) 评论(0) 推荐(0) 编辑

POJ 1470 Closest Common Ancestors (LCA,离线Tarjan算法)
摘要: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 阅读全文

posted @ 2013-09-05 09:34 kuangbin 阅读(1671) 评论(0) 推荐(0) 编辑

POJ 1470 Closest Common Ancestors (LCA, dfs+ST在线算法)
摘要: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 阅读全文

posted @ 2013-09-05 09:03 kuangbin 阅读(627) 评论(0) 推荐(0) 编辑

POJ 1330 Nearest Common Ancestors (LCA,dfs+ST在线算法)
摘要: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 阅读全文

posted @ 2013-09-05 08:42 kuangbin 阅读(1149) 评论(0) 推荐(0) 编辑

POJ 3580 SuperMemo (splay tree)
摘要: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, { 阅读全文

posted @ 2013-08-28 21:30 kuangbin 阅读(980) 评论(0) 推荐(0) 编辑

POJ 3468 A Simple Problem with Integers (splay tree入门)
摘要: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 阅读全文

posted @ 2013-08-24 23:16 kuangbin 阅读(1314) 评论(0) 推荐(0) 编辑

POJ 2417 Discrete Logging (Baby-Step Giant-Step)
摘要: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 .. 阅读全文

posted @ 2013-08-24 00:35 kuangbin 阅读(1628) 评论(0) 推荐(0) 编辑

POJ 1755 Triathlon (半平面交)
摘要: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 阅读全文

posted @ 2013-08-19 00:37 kuangbin 阅读(1531) 评论(0) 推荐(0) 编辑

POJ 3384 Feng Shui (半平面交)
摘要: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 阅读全文

posted @ 2013-08-18 16:19 kuangbin 阅读(1091) 评论(0) 推荐(0) 编辑

POJ 3525 Most Distant Point from the Sea (半平面交+二分)
摘要: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 阅读全文

posted @ 2013-08-18 15:37 kuangbin 阅读(834) 评论(0) 推荐(0) 编辑

POJ 1222 POJ 1830 POJ 1681 POJ 1753 POJ 3185 高斯消元求解一类开关问题
摘要: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 /* **************************. 阅读全文

posted @ 2013-08-17 22:12 kuangbin 阅读(3030) 评论(0) 推荐(1) 编辑

POJ 3237 Tree (树链剖分)
摘要: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 阅读全文

posted @ 2013-08-17 07:30 kuangbin 阅读(4891) 评论(0) 推荐(2) 编辑

1 2 3 4 5 ··· 11 下一页

导航

JAVASCRIPT: