C. Exponential notation time limit per test: 2 seconds memory limit per test:256 megabytes input: standard input output: standard output You are given a positive decimal number x. Your task is to convert it to the "simple exponential notation".…
题目链接: http://codeforces.com/problemset/problem/691/C 题目大意: 输入一个数,把它表示成a·10b形式(aEb).输出aEb,1<=a<10,b如果为1要省略Eb 题目思路: [模拟] 如果字符串没有‘.'我就在最后加上一个'.'方便处理. 先把头尾多余的0去掉,然后把这个数按照'.'拆成两半,统计整数部分的位数zs. 接着统计'.'后面的0的个数xs,再把所有数字放到一个数组里,再把头多余的0去掉(0.0000xx). 之后按照zs和sx的…
题目链接:http://codeforces.com/problemset/problem/691/C 题意: 给你一个浮点数,让你把这个数转化为 aEb 的形式,含义为 a * 10b, 其中 a 只能为一个不小于 1.0 且不大于等于10.0的小数, b 为一个不为0 的整数.具体样例参考原题的输入输出. 思路: 直接模拟就好,感觉写的好复杂,分了许多情况,需要注意许多特殊情况,注意不输出小数点 (".")的情况还有多余的 “0” 的情况 . 代码: #include <bi…
无聊写两个题解吧,上午做比赛拉的,感触很多! B. Barnicle time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Barney is standing in a bar and starring at a pretty girl. He wants to shoot her with his heart arrow but…
题目链接: C. Exponential notation time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given a positive decimal number x. Your task is to convert it to the "simple exponential notation"…
C. Exponential notation 题目连接: http://www.codeforces.com/contest/691/problem/C Description You are given a positive decimal number x. Your task is to convert it to the "simple exponential notation". Let x = a·10b, where 1 ≤ a < 10, then in gen…
Exponential notation You are given a positive decimal number x. Your task is to convert it to the "simple exponential notation". Let x = a·10b, where 1 ≤ a < 10, then in general case the "simple exponential notation" looks like &quo…
题目传送门 /* 贪心 + 模拟:首先,如果蜡烛的燃烧时间小于最少需要点燃的蜡烛数一定是-1(蜡烛是1秒点一支), num[g[i]]记录每个鬼访问时已点燃的蜡烛数,若不够,tmp为还需要的蜡烛数, 然后接下来的t秒需要的蜡烛都燃烧着,超过t秒,每减少一秒灭一支蜡烛,好!!! 详细解释:http://blog.csdn.net/kalilili/article/details/43412385 */ #include <cstdio> #include <algorithm> #i…
题目地址:http://codeforces.com/problemset/problem/350/C /* 题意:机器人上下左右走路,把其他的机器人都干掉要几步,好吧我其实没读懂题目, 看着样例猜出来的,这题也蛮水的 模拟+贪心:sort一下,从最近的开始走 注意:坐标有一个为0的比普通的少一半的步骤,每次干掉一个要返回原来的位置 */ #include <cstdio> #include <iostream> #include <algorithm> #includ…
题目地址:http://codeforces.com/contest/435/problem/C /* 题意:给一组公式,一组数据,计算得到一系列的坐标点,画出折线图:) 模拟题:蛮恶心的,不过也简单,依据公式得知折线一定是一上一下的,只要把两个相邻的坐标之间的折线填充就好 注意:坐标有可能为负数,所以移动值y初始化为1000,最后要倒过来输出 详细解释:http://blog.csdn.net/zhb1997/article/details/27877783 */ #include <cstd…
题目传送门 /* 模拟:这就是一道模拟水题,看到标签是贪心,还以为错了呢 题目倒是很长:) */ #include <cstdio> #include <algorithm> #include <iostream> #include <algorithm> #include <cstring> using namespace std; ; const int INF = 0x3f3f3f3f; ]; char s[MAXN]; int main(…
题目传送门 /* 题意:两堆牌,每次拿出上面的牌做比较,大的一方收走两张牌,直到一方没有牌 queue容器:模拟上述过程,当次数达到最大值时判断为-1 */ #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <stack> #include <cmath> #inc…
题目传送门 /* 题意:一串字符串,问要最少操作数使得成为合法的后缀表达式 贪心+模拟:数字个数 >= *个数+1 所以若数字少了先补上在前面,然后把不合法的*和最后的数字交换,记录次数 岛娘的代码实在难懂啊~ */ /************************************************ * Author :Running_Time * Created Time :2015-8-16 14:29:49 * File Name :K.cpp **************…
题目传送门 /* 模拟水题:给定n*m的空白方格,k次涂色,将(x,y)处的涂成黑色,判断第几次能形成2*2的黑色方格,若不能,输出0 很挫的判断四个方向是否OK */ #include <cstdio> #include <iostream> #include <algorithm> #include <cmath> #include <cstring> #include <map> using namespace std; ; c…
Circle of Students time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are nn students standing in a circle in some order. The index of the ii-th student is pipi. It is guaranteed that a…
Problem's Link:http://codeforces.com/problemset/problem/475/Chttp://codeforces.com/problemset/problem/475/C Mean: 给你一个网格,每个格子中是'X'或'.',你需要用一个刷子去将这些'X'刷掉,而且不能刷到'.',每次只能往下走或者往右走,让你选一把最小的刷子出来. analyse: 爆搜+模拟. 1)我们先遍历两遍,求出最小连续的x和y,那么x和y就是刷子最大能够达到的大小: 2)对…
Tokitsukaze and Discard Items time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Recently, Tokitsukaze found an interesting game. Tokitsukaze had nn items at the beginning of this game. Howeve…
A - Fashion in Berland 水 // #pragma comment(linker, "/STACK:102c000000,102c000000") #include <iostream> #include <cstdio> #include <cstring> #include <sstream> #include <string> #include <algorithm> #include &…
当考虑 Web 性能指标时,需要关注的目标数字应该是从您自己的用户那里获得的实际用户指标.最常见的方法是利用 Splunk 之类的工具来分析您的机器数据,该工具支持您分析和可视化您的访问权限和错误日志.利用这些工具,您可以收集某些方面的性能数据,比如读取资产的文件 I/O 时间,以及 API 请求的访问时间.但是,您仍然需要推断客户端性能数据,将信号调用方在某些高级的检查点上,或者只利用类似 WebPagetest 的工具运行综合测试.现在,W3C 已将 API 标准化,用户可以通过使用 Per…
关于transition的几个基本点: 1. transition()是针对与每个DOM element的,每个DOM element的transition并不会影响其他DOM element的transition操作: 2. 对于每一个DOM element的transition每次只能执行一个,如果在一个DOM element上添加了许多transition操作,只有最后一个会起作用,前面的都会被覆盖掉.但是例外是,当这些transition是chaining的形式连接的时候,这些trans…
上一篇随笔中总结了js数据类型检测的几个方法和jQuery的工具方法type方法,本篇要分析几个方法都依赖type方法,所以不了解type方法的请先参看http://www.cnblogs.com/yy-hh/p/4667950.html isFunction方法 用于测试是否为函数的对象 示例: function stub() {} var objs = [ function () {}, { x:15, y:20 }, null, stub, "function" ]; jQuer…
Go to the first, previous, next, last section, table of contents. Printing Output One of the most common actions is to print, or output, some or all of the input. You use the print statement for simple output. You use the printf statement for fancier…
在JavaScript中输出下面这些数值(注意不能作为字符串输出):0.1000000000000000000000000001(28位小数).0.100000000000000000000000001(27位小数).0.1000000000000000000000000456(28位小数).0.09999999999999999999999(23位小数),显示出来的结果都是数值0.1.又如,如果输出1/3的有理数表达式,结果是0.3333333333333333. document.write…
Operator Using Java operators Some operators change the value of an operand. This is called a side effect. Almost all operators work only with primitives. The exceptions are '=', '==' and '!=', which work with all objects. Precedence You should use p…
Matlab中有15种基本数据类型,主要是整型.浮点.逻辑.字符.日期和时间.结构数组.单元格数组以及函数句柄等.         1.整型:(int8:uint8:int16:uint16:int32:uint32:int64:uint64)通过intmax(class)和intmin(class) 函数返回该类整型的最大值和最小值,例如intmax('int8')=127:         2.浮点:(single:double) 浮点数:REALMAX('double')和REALMAX(…
jQuery.isNumeric( value ) Description: 判断指定参数是否是一个数字值(字符串形式的数字也符合条件),返回 true 或者 false. Example: $.isNumeric( "-10" ); // true $.isNumeric( 16 ); // true $.isNumeric( 0xFF ); // true $.isNumeric( "0xFF" ); // true $.isNumeric( "8e5…
1.jQuery.support//一组用于展示不同浏览器各自特性和bug的属性集合 2.jQuery.browser//浏览器内核标识.依据 navigator.userAgent 判断. 可用值: safari opera  msie mozilla 3.jQuery.browser.version//浏览器渲染引擎版本号 4.jQuery.boxModel//浏览器是否使用标准盒模型渲染页面. 建议使用 jQuery.support.boxModel 代替.W3C CSS 盒模型. 5.j…
The following table describes the standard numeric format specifiers and displays sample output produced by each format specifier. See the Notes section for additional information about using standard numeric format strings, and the Example section f…
一.上周作业回顾 1.登陆接口: 思路流程: 1.登陆,三次锁定用户 2.用户信息文件,黑名单文件 3.检测黑名单,如输入账号在黑名单中存在,不允许登陆 4.用户密码判断 主要知识点:while,for循环,if判断,文件操作 2.三级菜单: 1.写字典,大字典里套小字典,再在小字典里套列表 2.程序开始,列出大字典力所有的keys. 3.用户选择后,列出小字典的key. 4.用户再次选择后,列出小字典中的列表. 5.在用户选择的时候,可以加入判断,如是否输入正确 6.在用户选择的时候,加入b返…
DecimalFormat继承自NumberFormat,可以使用它将十进制的数以不同形式格式化为字符串形式,可以控制前导和尾随0.前缀.后缀.分组(千).小数分隔符等,如果要更改格式符号(例如小数点分隔符). 它有各种各样的设计使其能够解析和格式化数字的特征区域设置,包括对西方.阿拉伯和印度数字的支持.它也支持不同类型的数字,包括整数(123),定点数字(123.4),科学符号(1.23 e4),百分比(12%),以及货币金额(123美元).所有这些都可以本地化. 可以将其DecimalFor…