问题出处:http://codeforces.com/problemset/problem/887/A 问题大意:对于给出的一串二进制数,能否通过去掉一些数字,使之成为十进制下64的倍数 #include<iostream> #include<algorithm> using namespace std; //题目表述的删除,而不是把1换成0 int main(){ string s; cin>>s; //不考虑第6位的高位数 //对string类 find函数的使用…
A. Div. 64 time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Top-model Izabella participates in the competition. She wants to impress judges and show her mathematical skills. Her problem is f…
A. Div. 64 time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Top-model Izabella participates in the competition. She wants to impress judges and show her mathematical skills. Her problem is f…
javascript函数一共可分为五类:    ·常规函数    ·数组函数    ·日期函数    ·数学函数    ·字符串函数    1.常规函数    javascript常规函数包括以下9个函数:    (1)alert函数:显示一个警告对话框,包括一个OK按钮.      (2)confirm函数:显示一个确认对话框,包括OK.Cancel按钮.      (3)escape函数:将字符转换成Unicode码.      (4)eval函数:计算表达式的结果.    (5)isNaN…
以下是我整理的DIV+CSS常用网页布局技巧,仅供学习与参考! 第一种布局:左边固定宽度,右边自适应宽度 HTML Markup <div id="left">Left sidebar</div>  <div id="content">Main Content</div> CSS Code <style type="text/css"> *{    margin: 0;    paddi…
SQL server 创建 修改表格 及表格基本增删改查 及 高级查询 及 (数学.字符串.日期时间)函数   --创建表格 create table aa ( UserName varchar(50) primary key, --建主键. Password varchar(20) not null, --不能为空 Name varchar(20) unique, --唯一键,不能重复 sex bit default 1, --建默认约束(缺省约束) birthday datetime che…
一.数学函数 数学函数主要用于处理数字,包括整型.浮点数等. ABS(x) 返回x的绝对值 SELECT ABS(-1) -- 返回1 CEIL(x),CEILING(x) 返回大于或等于x的最小整数 SELECT CEIL(1.5) -- 返回2 FLOOR(x) 返回小于或等于x的最大整数 SELECT FLOOR(1.5) -- 返回1 RAND() 返回0->1的随机数 SELECT RAND() --0.93099315644334 RAND(x) 返回0->1的随机数,x值相同时返…
一.系统函数 1.聚合函数 聚合函数常用于GROUP BY子句,在SQL Server 2008提供的所有聚合函数中,除了COUNT函数以外,聚合函数都会忽略空值AVG.COUNT.COUNT_BIG.MAX .MIN.SUM...... 2.数学函数 ABS ROUND FLOOR CEILING...... 3.字符串函数 LEFT LEN LOWER LTRIM REPLACE RIGHT...... 4.日期和时间函数 DATEADD DATEDIFF  DATENAME DATEPAR…
一,数学函数主要用于处理数字,包括整型.浮点数等. ABS(X) 返回x的绝对值 SELECT ABS(-1)--返回1 CEll(X),CEILING(x)  返回大于或等于x的最小整数 SELECT CEIL(1.5)--返回2 FLOOR(X) 返回小于或等于x的最大整数 SELECT FLOOR(1.5)--返回1 RAND()  返回0到1的随机数 SELECT RAND() --0.93099315644334 RAND(X) X值相同返回的随机数相同 SELECT RAND(2)…
方法1:利用DataTable中的Compute方法 1 string expression = "1+2*3"; 2 DataTable eval = new DataTable();object result = eval.Compute(expression, “”); 方法2:利用xPath表达式 1 publicstaticdoubleEvaluate(string expression) 2 { 3 return(double)newSystem.Xml.XPath.XPa…
这个系列是我在学习Python语言的过程中记录的笔记,主要是一些知识点汇总,而非学习教程,可供有一定编程基础者参考.文中偏见和不足难以避免,仅供参考,欢迎批评指正. 本系列笔记主要参考文献是官网文档:http://docs.python.org/.在此向文档编辑者致谢.请勿将本文用于商业用途. 一.Python语言介绍 首先,Python是一种广泛应用的通用高级编程语言,具有较高的抽象层次,支持面向对象的编程方法.其具有高级的数据结构和许多方便的库文件,可以完成文件IO.系统调用.网络编程,甚至…
B. Ohana Cleans Up Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/554/problem/B Description Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clea…
A. Kyoya and Photobooks Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/554/problem/A Description Kyoya Ootori is selling photobooks of the Ouran High School Host Club. He has 26 photos, labeled "a" to "z", a…
题目链接: 题目 D. Alyona and Strings time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output 问题描述 After returned from forest, Alyona started reading a book. She noticed strings s and t, lengths of which are…
数学so奇妙.. 这题肯定会有一个循环节 就是最小公倍数 对于公倍数内的相同的数的判断 就要借助最大公约数了 想想可以想明白 #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<stdlib.h> #include<vector> using namespace std; #define N 1000100 #defin…
题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=2866&rd=5853 主要是要对字符串的操作要熟悉,熟练使用 sstream 流可以大大简化操作,如这个题目,如果不用 sstream 流的话,用 sscanf 函数非常麻烦,因为输入的数据中数字的个数不是一样的,还有一个问题就是多关键字的排序,用 sort 函数时要自己写比较函数. 另外那个得到实现四则运算的方法也很巧妙,我刚始用的方法比较麻烦,这种方法看别人…
[题意]给n个字符串组成的集合,然后有m个询问(0 ≤ n ≤ 3·105, 0 ≤ m ≤ 3·105) ,每个询问都给出一个字符串s,问集合中是否存在一个字符串t,使得s和t长度相同,并且仅有一个字符不同.(字符串总长度为6·105),所有字符只有a,b,c. [题解]因为只有三种字符,用Trie最合适.先把n个字符串插入到Trie中.然后每读入一个字符串,首先枚举差异字符的位置,依次替换为另外两种字符,并检查是否合法.如果合法就直接输出YES. 显然每替换一个字符就从头检查一遍太浪费时间,…
题意:丑数就是质因子只有2,3,5 ,7,的数,另外1也是丑数.求第n(1=<n<=5842)个丑数,n=0,结束. 思路:.3.5或者7的结果(1除外).那么,现在最主要的问题是如何排序,而且使得求得数不重复. <阶梯式上升>:从ans[1]=1,p1=1,p2=1,p3=1,p4=1,分别用2,3,5,7乘ans[px],得到一个v(min),这个v就是下一个ans, 同时,对应的px++; 技巧:因为题目中是多组输入,所以没必要没输入一个数就把程序跑一遍,而且n有上限,索性用…
A. Numbers Joke time limit per test:2 seconds memory limit per test:64 megabytes input:standard input output:standard output   Input The input contains a single integer a (1 ≤ a ≤ 30). Output Output a single integer. Example Input 3 Output 27 题目链接:ht…
C. Fly time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Natasha is going to fly on a rocket to Mars and return to Earth. Also, on the way to Mars, she will land on n−2n−2 intermediate planet…
题目链接:http://codeforces.com/contest/832/problem/B B. Petya and Exam time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output It's hard times now. Today Petya needs to score 100 points on Informatics…
C. Zero-One 题目连接: http://codeforces.com/contest/135/problem/C Description Little Petya very much likes playing with little Masha. Recently he has received a game called "Zero-One" as a gift from his mother. Petya immediately offered Masha to pla…
A. Secrets Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/333/problem/A Description Gerald has been selling state secrets at leisure. All the secrets cost the same: n marks. The state which secrets Gerald is selling, has…
一.题面 题目链接 二.分析 一个简单的数学题目,这里首先要把x分解了看 $x = kd + c$ 这样原问题中的n就变成了 $n = dc$ 上面这个式子中,c因为是x除k取余得到的,那么可以肯定 $c < k$ 有了这个式子,就可以直接暴力去试满足条件的c,并且最小的d就可以满足x的最小值. 三.AC代码 #include <bits/stdc++.h> using namespace std; #define INF 1e6+4 int main() { int K, N; //f…
A. Two Substrings time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given string s. Your task is to determine if the given string s contains two non-overlapping substrings "AB"…
D. Soldier and Number Game time limit per test 3 seconds memory limit per test 256 megabytes input standard input output standard output Two soldiers are playing a game. At the beginning first of them chooses a positive integer n and gives it to the…
题目链接:http://codeforces.com/contest/777/problem/D 题解: 题意:给出n行字符串,对其进行字典序剪辑.我自己的想法是正向剪辑的,即先对第一第二个字符串进行剪辑,但是这样却不能保证前面的操作是正确的,当后面突然出现一个字典序很小的字符串,那么前面的操作将非法.这种方法错在不能预知正在操作的字符串的字典序限度.看了别人的代码,发现是反向进行剪辑的,即从倒数第一第二个字符串进行剪辑,直到第一个.因为倒数第一个的字典序必须是最大,所以倒数第二个的字典序限度已…
最大的数 时间限制:1000 ms  |           内存限制:65535 KB 难度:3 描述 小明和小红在打赌说自己数学学的好,于是小花就给他们出题了,考考他们谁NB,题目是这样的给你N个数 在这n个数之间添加N-1个*或+,使结果最大,但不可以打乱原顺序,请得出这个结果 如 1 3 5 结果是(1+3)*5=20:最大 可以添加若干个括号,但一定要保证配对,但是每两个数之间只可能有一个*或+ 数列最前和最后不应有+或乘 小明想赢小红但是他比较笨,请你帮帮他 输入 多组测试数据以EO…
div设置contenteditable="true",即可编辑,除从网页粘贴过来内容的格式 <div contenteditable="true" id="t"></div> <script> var d = document.getElementById( "t" ); document.addEventListener( "keyup", function() {…
B. Split a Number time limit per test2 seconds memory limit per test512 megabytes inputstandard input outputstandard output Dima worked all day and wrote down on a long paper strip his favorite number n consisting of l digits. Unfortunately, the stri…