Very often, especially in programming contests, we treat a sequence of non-whitespace characters as a string. But sometimes, a string may contain whitespace characters or even be empty. We can have such strings quoted and escaped to handle these case…
Seven Segment Display Time Limit: Seconds Memory Limit: KB A seven segment display, or seven segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot matrix displays. Sev…
转载留存:http://blog.sina.com.cn/s/blog_46d0362d0102v8ii.html 性能测试需要模拟多种场景,经常受制于资源限制,没办法建立贴近实际部署环境的场景.因而需要借助一些软硬件提供的特性来模拟近似的环境.本文提到的JMeter是一种开源的模拟测试解决方案,可以通过多线程并发的方式来持续提供压力测试源.   1.下载安装 仅仅需要从apache的网站找到下载包,解压到本地文件目录即可. http://jmeter.apache.org/download_j…
其实这篇文章开出来主要是水文章%% %% 栈--后进先出的婊 特点:只能在某一端插入和删除的特殊的线性表 操作:进栈--PUSH->向栈顶插入元素 出栈--POP-->将栈顶元素删除 实现: 定义一个长为n的数组,用一个top(相当于指针)指向栈顶,若top=0,则表示栈空:top=n,则表示栈满. 进栈时top+1,出栈时top-1. 栈指针(top)在运算中永远都指向栈顶 若top>n(n为栈的长度),则为溢出,做出错处理:若top<0,则为下溢,同样做出错处理  [具体讲就是…
Martian Addition Time Limit: 2 Seconds      Memory Limit: 65536 KB   In the 22nd Century, scientists have discovered intelligent residents live on the Mars. Martians are very fond of mathematics. Every year, they would hold an Arithmetic Contest on M…
TIANKENG’s restaurant(Ⅱ) Time Limit: 16000/8000 MS (Java/Others)    Memory Limit: 130107/65536 K (Java/Others)Total Submission(s): 456    Accepted Submission(s): 149 Problem Description After improving the marketing strategy, TIANKENG has made a fort…
本题围绕:数学公式模拟进制转换 HDU4814 Golden Radio Base 题目描述 将一个十进制的非负整数转换成E(黄金分割数)进制的数 输入 不大于10^9的非负整数,处理到文件尾 输出 转换成的E进制数(可能含有小数) 样例输入 1 2 3 6 10 样例输出 1 10.01 100.01 1010.0001 10100.0101 题目分析 对于本题,要注意的点有:首先对于一个十进制的正数,我们是可以严格转换成一个E(黄金分割数)进制的数的,而不是涉及到约等于,例如10-base的…
以下内容基本来自<算法笔记>,作者为胡凡,建议直接买书看,我这里只是摘抄部分当笔记,不完整的. 简单模拟 就是一类"题目怎么说你就怎么做"的题目.这类题目不涉及算法,只是根据题目描述来进行代码的编写. 例子: 思路: #include <cstdio> init main() { int n, step = 0; scanf("%d", &n); while(n != 1) { if(n%2==0) { n = n / 2; } el…
题目传送门 /* BFS+模拟:dp[i][j][p] 表示走到i,j,方向为p的步数为多少: BFS分4种情况入队,最后在终点4个方向寻找最小值:) */ #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <queue> using namespace std; ; cons…
题目传送门 /* 模拟:手敲map一一映射,累! 除了忘记读入字符串不能用gets用getline外还是很顺利的AC了:) */ #include <cstdio> #include <iostream> #include <algorithm> #include <cmath> #include <cstring> #include <string> #include <map> #include <set>…