[STL] day 1~2 Problem Set】的更多相关文章

Q#1 #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; void print(int& t){ //for_each fnc: parameter accept elements T cout << t << " "…
题目传送门 题意:训练指南P187 分析:用vector存id下标,可以用map,也可以离散化用数组存(发现不用离散化也可以) map #include <bits/stdc++.h> using namespace std; map<int, vector<int> >mp; int main(void) { int n, m; while (scanf ("%d%d", &n, &m) == 2) { mp.clear (); f…
这是一篇Dr. Dobb's Journal对STL之父stepanov的采访.文中数次提到STL的基本思想.语言的特性.编程的一些根本问题等,非常精彩.这篇文章让我想去拜读下stepanov的大作<Elements of Programming>了.原文链接: http://www.stepanovpapers.com/drdobbs-interview.html 我先对文章内容做下总结,并在最后附上原文,把一些认为重要又精彩的语句进行了标红. Stepanov讲到其关于“泛型编程”(gen…
12.10高一练习题 1.要求: 这周回顾复习的内容是循环.递归.stl. 不要因为题目简单就放弃不做,现在就是练习基础. 2.练习题: (1)循环   题目解析与代码见随笔分类  NOI题库 http://noi.openjudge.cn/ch0106/    10-15题 http://noi.openjudge.cn/ch0105/     37-45题 http://noi.openjudge.cn/ch0107/     28-35题 (2)递归   题目解析与代码见随笔分类 递归 h…
Easy Problem from Rujia Liu? Though Rujia Liu usually sets hard problems for contests (for example, regional contests like Xi'an 2006, Beijing 2007 and Wuhan 2009, or UVa OJ contests like Rujia Liu's Presents 1 and 2), he occasionally sets easy probl…
11991 - Easy Problem from Rujia Liu? Time limit: 1.000 seconds Problem E Easy Problem from Rujia Liu? Though Rujia Liu usually sets hard problems for contests (for example, regional contests like Xi'an 2006, Beijing 2007 and Wuhan 2009, or UVa OJ con…
Problem I: STL--多重集的插入和删除 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 1729  Solved: 1258[Submit][Status][Web Board] Description 给你一个集合,一开始集合是空集,然后进行若干操作,最后你要从小到大输出集合中的元素,以空格隔开.(集合中可能会有相同元素) Input 一共有若干输入数据,开头一个n(n<=20),n=0代表输入结束. 然后有n行,每行有2种形式: &quo…
Train Problem I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 41471    Accepted Submission(s): 15510 Problem Description As the new term comes, the Ignatius Train Station is very busy nowaday…
Train Problem I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 20521    Accepted Submission(s): 7712 Problem Description As the new term comes, the Ignatius Train Station is very busy nowadays…
option=com_onlinejudge&Itemid=8&page=show_problem&problem=3142" target="_blank" style="">题目链接:uva 11991 - Easy Problem from Rujia Liu? 题目大意:给出一个包括n个整数的数组,你须要回答若干询问,每次询问两个整数k和v,输出从左到右第k个v的下标 解题思路:用map映射一个vector,相应即为m…