随笔分类 -  ACM —— 数据结构

uva 11997 K Smallest Sums
摘要:解题思路:STL —— priority_queue 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: uva 11997 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #include 7 #include 8 #include 9 #include 10... 阅读全文

posted @ 2013-09-17 17:02 SCNU20102200088 阅读(228) 评论(0) 推荐(0)

uvalive 3135 Argus
摘要:解题思路:STL —— priority_queue 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: uvalive 3135 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #include 7 #include 8 #include 9 #include ... 阅读全文

posted @ 2013-09-17 16:19 SCNU20102200088 阅读(244) 评论(0) 推荐(0)

uva 11991 Easy Problem from Rujia Liu?
摘要:解题思路:STL —— vector, map 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: uva 11991 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #include 7 #include 8 #include 9 #include 10 #include 11 ... 阅读全文

posted @ 2013-09-10 19:40 SCNU20102200088 阅读(226) 评论(0) 推荐(0)

uva 11995 I Can Guess the Data Structure!
摘要:解题思路:STL —— stack, queue, priority_queue 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: uva 11995 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #include 7 #include 8 #include ... 阅读全文

posted @ 2013-09-10 17:31 SCNU20102200088 阅读(174) 评论(0) 推荐(0)

poj 2823 Sliding Window
摘要:题目链接:http://poj.org/problem?id=2823解题思路:单调队列 或 RMQ 1 //解题方法:单调队列 2 3 /////////////////////////////////////////////////////////////////////////// 4 //problem_id: poj 2823 5 //user_id: SCNU20102200088 6 /////////////////////////////////////////////////////////////////////////// 7 8 #include ... 阅读全文

posted @ 2013-08-17 00:07 SCNU20102200088 阅读(134) 评论(0) 推荐(0)

fzu 1894 志愿者选拔
摘要:题目链接:http://acm.fzu.edu.cn/problem.php?pid=1894解题思路:单调队列 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: fzu 1894 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #include 7 #include 8 #inc... 阅读全文

posted @ 2013-08-16 16:05 SCNU20102200088 阅读(177) 评论(0) 推荐(0)

poj 3264 Balanced Lineup
摘要:题目链接:http://poj.org/problem?id=3264解题思路:RMQ(Range Minimum/Maximum Query). 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: poj 3264 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #include 7.. 阅读全文

posted @ 2013-08-16 09:31 SCNU20102200088 阅读(122) 评论(0) 推荐(0)

poj 1363 Rails
摘要:题目链接:http://poj.org/problem?id=1363解题思路:STL —— stack 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: poj 1363 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #include 7 #include 8 #include... 阅读全文

posted @ 2013-08-15 22:30 SCNU20102200088 阅读(216) 评论(0) 推荐(0)

poj 1028 Web Navigation
摘要:题目链接:http://poj.org/problem?id=1028解题思路:STL —— stack 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: poj 1028 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #include 7 #include 8 ... 阅读全文

posted @ 2013-08-15 22:18 SCNU20102200088 阅读(161) 评论(0) 推荐(0)

STL——stack
摘要:① 声明 stackstack s;② stack 的成员函数s.push(x); 将 x 压栈,无返回值s.pop(); 退栈,无返回值s.top(); 取栈顶元素,返回栈顶元素s.empty(); 判断栈是否为空,如果是,返回 1,否则返回 0s.size(); 返回栈中元素的个数③ stack 没有提供清空操作的函数,但可间接实现while(!s.empty()) s.pop(); 1 //使用 stack 实现十进制向八进制的转换 2 #include 3 #include 4 using namespace std; 5 6 int main(){ 7 int n; 8 ... 阅读全文

posted @ 2013-07-20 15:56 SCNU20102200088 阅读(227) 评论(0) 推荐(0)

导航