• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






goodniao_1

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2014年3月24日

Same binary weight bitset(STL)
摘要: 题目来源:http://acm.nyist.net/JudgeOnline/problem.php?pid=412Same binary weight时间限制:300ms | 内存限制:65535KB难度:3描述The binary weight of a positive integer is the number of 1's in its binary representation.for example,the decmial number 1 has a binary weight of 1,and the decimal number 1717 (which is 1101 阅读全文
posted @ 2014-03-24 22:35 goodniao_1 阅读(195) 评论(0) 推荐(1)
 
括号配对问题 栈(stack)的利用
摘要: 题目来源:http://acm.nyist.net/JudgeOnline/problem.php?pid=2括号配对问题时间限制:3000ms | 内存限制:65535KB难度:3描述现在,有一行括号序列,请你检查这行括号是否配对。输入第一行输入一个数N(0#include #include #include #include #include #include #include#include#include#include#include#include#includeusing namespace std;typedef long long LL;char s[10010];int m 阅读全文
posted @ 2014-03-24 20:14 goodniao_1 阅读(252) 评论(0) 推荐(0)
 
汉诺塔(三) 判断操作是否合法 + 栈(stack)数组
摘要: 题目来源:http://acm.nyist.net/JudgeOnline/problem.php?pid=93汉诺塔(三)时间限制:3000ms | 内存限制:65535KB难度:3描述在印度,有这么一个古老的传说:在世界中心贝拿勒斯(在印度北部)的圣庙里,一块黄铜板上插着三根宝石针。印度教的主神梵天在创造世界的时候,在其中一根针上从下到上地穿好了由大到小的64片金片,这就是所谓的汉诺塔。不论白天黑夜,总有一个僧侣在按照下面的法则移动这些金片:一次只移动一片,不管在哪根针上,小片必须在大片上面。僧侣们预言,当所有的金片都从梵天穿好的那根针上移到另外一根针上时,世界就将在一声霹雳中消灭,而梵塔 阅读全文
posted @ 2014-03-24 16:42 goodniao_1 阅读(195) 评论(0) 推荐(0)
 
字符串替换 string (stl) find + replace
摘要: 题目来源:http://acm.nyist.net/JudgeOnline/problem.php?pid=113字符串替换时间限制:3000ms | 内存限制:65535KB难度:2描述编写一个程序实现将字符串中的所有"you"替换成"we"输入输入包含多行数据每行数据是一个字符串,长度不超过1000数据以EOF结束输出对于输入的每一行,输出替换后的字符串样例输入you are what you do样例输出we are what we do分析:1:find(string&s, location) , 从 location 位置开始,在字符串 阅读全文
posted @ 2014-03-24 15:36 goodniao_1 阅读(749) 评论(0) 推荐(1)
 
懒省事的小明 + 优先队列(单元素的比较函数) + longlong
摘要: 题目来源:http://acm.nyist.net/JudgeOnline/problem.php?pid=55懒省事的小明时间限制:3000ms | 内存限制:65535KB难度:3描述 小明很想吃果子,正好果园果子熟了。在果园里,小明已经将所有的果子打了下来,而且按果子的不同种类分成了不同的堆。小明决定把所有的果子合成一堆。 因为小明比较懒,为了省力气,小明开始想点子了: 每一次合并,小明可以把两堆果子合并到一起,消耗的体力等于两堆果子的重量之和。可以看出,所有的果子经过n-1次合并之后,就只剩下一堆了。小明在合并果子时总共消耗的体力等于每次合并所耗体力之和。 因为还要花大力气把这些果.. 阅读全文
posted @ 2014-03-24 15:01 goodniao_1 阅读(251) 评论(0) 推荐(0)
 
long long _int64使用总结
摘要: 前言: 在16位环境下,int/unsigned int 占16位,long/unsigned long占32位 在32位环境下,int占32位,unsigned int占16位,long/unsigned long占32位何时需要使用: long 和 int 范围是[-2^31,2^31),即-2147483648~2147483647,而unsigned范围是[0,2^32),即0~4294967295,所以常规的32位整数只能够处理40亿左右,当遇到比40亿大的多的数就要用到64位。64位使用范围: 不同的编译器对64位整数的扩展有所不同,VC使用__int64/unsigned... 阅读全文
posted @ 2014-03-24 14:48 goodniao_1 阅读(263) 评论(0) 推荐(0)
 
一种排序 set<stl> 无重复 + < 符号重载 ==
摘要: 题目来源:http://acm.nyist.net/JudgeOnline/problem.php?pid=8一种排序时间限制:3000ms | 内存限制:65535KB难度:3描述现在有很多长方形,每一个长方形都有一个编号,这个编号可以重复;还知道这个长方形的宽和长,编号、长、宽都是整数;现在要求... 阅读全文
posted @ 2014-03-24 11:35 goodniao_1 阅读(341) 评论(0) 推荐(0)
 
ASCII码排序 multiset<stl> 有重复从小到大输出
摘要: 题目来源:http://acm.nyist.net/JudgeOnline/problem.php?pid=4ASCII码排序时间限制:3000ms | 内存限制:65535KB难度:2描述输入三个字符(可以重复)后,按各字符的ASCII码从小到大的顺序输出这三个字符。输入第一行输入一个数N,表示有N组测试数据。后面的N行输入多组数据,每组输入数据都是占一行,有三个字符组成,之间无空格。输出对于每组输入数据,输出一行,字符中间用一个空格分开。样例输入3qweasdzxc样例输出e q wa d sc x z分析:假设有多个字符n输入。代码如下:#include #include #includ 阅读全文
posted @ 2014-03-24 09:55 goodniao_1 阅读(334) 评论(0) 推荐(0)
 
Binary String Matching string(stl) find()函数的应用 完全不用kmp
摘要: 题目来源:http://acm.nyist.net/JudgeOnline/problem.php?pid=5Binary String Matching时间限制:3000ms | 内存限制:65535KB难度:3描述Given two strings A and B, whose alphabet consist only ‘0’ and ‘1’. Your task is only to tell how many times does A appear as a substring of B? For example, the text string B is ‘1001110110’ 阅读全文
posted @ 2014-03-24 09:23 goodniao_1 阅读(406) 评论(0) 推荐(1)