
STL
文章平均质量分 82
Modiz
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
I Can Guess the Data Structure!(水题,不过锻炼了stack,queue,priority的用法)
题意:就是给出一系列的操作和返回值,判断是队列还是优先队列还是栈;#include #include #include using namespace std;int main(){ int n; while (~scanf("%d",&n)) { queue que; priority_queue pque; stack tack; int k1=1,k2=原创 2013-05-16 21:16:18 · 727 阅读 · 0 评论 -
unique函数,获得相邻序列不重复的个数。
unique函数存在于#include 头文件中。作用是去除相邻原创 2014-07-06 20:25:14 · 1218 阅读 · 0 评论 -
Hdu 4941 Magical Forest(map+离散化)
Magical ForestTime Limit: 24000/12000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 273 Accepted Submission(s): 128Problem DescriptionThere is原创 2014-08-12 20:19:48 · 824 阅读 · 0 评论 -
最长公共子列和最长公共子串。LCS && LCSL
最长公共子串:在两个字符串中找到一个最长的公共子串,要求子串在原串中是连续的。最长公共子序列:在两个字符串中找到一个最长的公共子串,不要求子串在原串中是连续的。原创 2014-07-19 10:51:34 · 1002 阅读 · 0 评论 -
Codeforces Round #FF (Div. 2)D. DZY Loves Modification
D. DZY Loves Modificationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs we know, DZY loves playing gam原创 2014-07-15 08:27:41 · 826 阅读 · 0 评论 -
STL next_premutation函数的C++和C的作用。
众所周知有很多情况是求一个序列的所有排列。原创 2014-07-24 16:19:52 · 2747 阅读 · 0 评论 -
HDU 4857 逃生。
逃生Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 582 Accepted Submission(s): 156Problem Description糟糕的事情发生啦,现在大家都忙着逃命。但是逃命的通原创 2014-07-22 10:05:54 · 875 阅读 · 0 评论 -
湖大训练赛1 Shipuratt
ShipuraTime Limit: 20000ms, Special Time Limit:50000ms, Memory Limit:65536KBTotal submit users: 17, Accepted users: 14Problem 12817 : No special judgementProblem description原创 2014-07-21 10:03:52 · 802 阅读 · 0 评论 -
栈与队列....
View Code #include #include #include using namespace std; int x2,y2; int ans = 0;int dre_x[5] = {0,-1,1,0,0}; int dre_y[5] = {0,0,0,-1,1};int map[12][12];int visit[12][12];class Point{public: int原创 2013-07-29 14:40:46 · 663 阅读 · 0 评论 -
HDU 1873 看病要排队
Description看病要排队这个是地球人都知道的常识。不过经过细心的0068的观察,他发现了医院里排队还是有讲究的。0068所去的医院有三个医生(汗,这么少)同时看病。而看病的人病情有轻重,所以不能根据简单的先来先服务的原则。所以医院对每种病情规定了10种不同的优先级。级别为10的优先权最高,级别为1的优先权最低。医生在看病时,则会在他的队伍里面选择一个优先权最高的人进行诊治。如果原创 2013-12-07 09:56:27 · 697 阅读 · 0 评论 -
next_permutation(排序后列)prev_permutation(排序前列)
Description题目描述: 大家知道,给出正整数n,则1到n这n个数可以构成n!种排列,把这些排列按照从小到大的顺序(字典顺序)列出,如n=3时,列出1 2 3,1 3 2,2 1 3,2 3 1,3 1 2,3 2 1六个排列。 任务描述: 给出某个排列,求出这个排列的下k个排列,如果遇到最后一个排列,则下1排列为第原创 2013-11-13 18:50:06 · 975 阅读 · 0 评论 -
Easy Problem from Rujia Liu?(map+vector用法)
题意:输入n个数,m组询问,每组询问包含两个整数k,v,询问整数v第k次出现的位置...STL果然神奇~本来准备二维数组搞定,写了一半发现数组太大开不了,就又想到STL的map,然后还是行不通,到网上找一下,结果又发现了vector这个神奇的东东,貌似这个昨天才准备好看看的...Easy Problem from Rujia Liu?Though Rujia Liu usually s原创 2013-05-14 15:19:49 · 903 阅读 · 0 评论 -
(优先队列)K Smallest Sums
Problem KK Smallest SumsYou're given k arrays, each array has k integers. There are kk ways to pick exactly one element in each array and calculate the sum of the integers. Your task is to find原创 2013-05-10 09:12:04 · 893 阅读 · 0 评论 -
STL vetor(容器)的用法
vector之所以被认为是一个容器,是因为它能够像容器一样存放各种类型的对象,简单地说,vector是一个能够存放任意类型的动态数组,能够增加和压缩数据。为了可以使用vector,必须在你的头文件中包含下面的代码:#include vector属于std命名域的,因此需要通过命名限定,如下完成你的代码:using std::vector;vector vInts;或者连在一转载 2013-05-13 20:11:58 · 823 阅读 · 0 评论 -
string+append的用法!!!
basic_string::append向string 的后面加字符或字符串。(比+=, push_back 更灵活)(1)向string的后面加C-stringbasic_string& append( const value_type*_Ptr );string s ( "Hello " ); // s=”Hello”const char *c = "Out T转载 2013-08-19 09:22:31 · 14616 阅读 · 1 评论 -
操作系统的课程设计《进程管理》
时间转轮法和最短作业优先算法。先mark一下。#include #include #include #include #include #include using namespace std;struct node{ char name; int intime; int runtime; int dotime; int id; bool operator <(con原创 2014-12-25 17:35:24 · 5087 阅读 · 8 评论