摘要:解题思路:STL —— priority_queue 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: uva 11997 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #include 7 #include 8 #include 9 #include 10...
阅读全文
摘要:解题思路:STL —— priority_queue 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: uvalive 3135 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #include 7 #include 8 #include 9 #include ...
阅读全文
摘要:解题思路: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 ...
阅读全文
摘要:解题思路:STL —— stack, queue, priority_queue 1 /////////////////////////////////////////////////////////////////////////// 2 //problem_id: uva 11995 3 //user_id: SCNU20102200088 4 /////////////////////////////////////////////////////////////////////////// 5 6 #include 7 #include 8 #include ...
阅读全文
摘要:题目链接:http://poj.org/problem?id=2823解题思路:单调队列 或 RMQ 1 //解题方法:单调队列 2 3 /////////////////////////////////////////////////////////////////////////// 4 //problem_id: poj 2823 5 //user_id: SCNU20102200088 6 /////////////////////////////////////////////////////////////////////////// 7 8 #include ...
阅读全文
摘要:题目链接: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...
阅读全文
摘要:题目链接: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..
阅读全文
摘要:题目链接: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...
阅读全文
摘要:题目链接: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 ...
阅读全文
摘要:① 声明 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 ...
阅读全文