随笔分类 -  C++STL

摘要:Problem 2088 最长队名 Problem Description Jack所在的班级决定组团报名参加FZU校赛。为了体现班级的团结和睦,班长决定用班级所有人的名字连起来组成一个史上最长最醒目的队名。 因为听说在分数相同的情况下,队名字典序小的会排在更前面,班长还希望连成的史上最长队名拥有最 阅读全文
posted @ 2016-03-04 18:16 ACMSaga 阅读(505) 评论(0) 推荐(0)
摘要:As Easy As A+B Problem Description These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do s 阅读全文
posted @ 2016-02-25 11:08 ACMSaga 阅读(385) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Message queue is the basic fundamental of windows system. For each process, the system maintains a message queue. If somethin 阅读全文
posted @ 2016-02-09 20:17 ACMSaga 阅读(433) 评论(0) 推荐(0)
摘要:题目链接 Problem Description Let S = s1 s2 … s2n be a well-formed string of parentheses. S can be encoded in two different ways: By an integer sequence P 阅读全文
posted @ 2016-02-05 15:41 ACMSaga 阅读(294) 评论(0) 推荐(0)
摘要:题目链接 Problem Description 读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。 Input 测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算符之间用一个空格分隔。没有非法表达式。当一行中只有0时输入结束,相应的结果不要 阅读全文
posted @ 2016-02-05 15:25 ACMSaga 阅读(1257) 评论(0) 推荐(0)
摘要:Time Limit: 1 Sec Memory Limit: 128 MB Description 有一个长度为n的字符串(只包含小写字母),操作m次,每次操作交换两个字母,输出最终字符串。 Input 多组输入,每组第一行为n,m表示字符串长度和操作数,1<n,m<=100000第二行为长度n的 阅读全文
posted @ 2016-01-29 13:11 ACMSaga 阅读(379) 评论(0) 推荐(0)
摘要:Time Limit: 1 Sec Memory Limit: 128 MB Description 你的任务是编写一个程序实现简单的字符宽度编码方法。规则如下:将任何2~9个相同字符的序列编码成2个字符:第1个字符是序列的长度,用数字字符2~9表示,第2个字符为这一串相同字符序列中的字符。超过9个 阅读全文
posted @ 2016-01-27 19:54 ACMSaga 阅读(330) 评论(0) 推荐(0)
摘要:题目链接 题解:将每个单词倒置,可以用char数组,然后用空格分隔,这里用的是string和stringstream。 #include <cstdio> #include <iostream> #include <string> #include <sstream> #include <cstri 阅读全文
posted @ 2016-01-26 15:57 ACMSaga 阅读(140) 评论(0) 推荐(0)