Alice and Bob is playing a game, and this time the game is all about the absolute value!
Alice has N different positive integers, and each number is not greater than N. Bob has a lot of blank paper, ...
分类:
其他好文 时间:
2014-08-26 15:37:46
阅读次数:
228
题解:求区间K小,函数式线段树模板题。#include #include #include using namespace std;const int N=3000005;struct node{int num,id;}a[N];int T,n,m,x,y,z,tot,b[N],head[N],so...
分类:
其他好文 时间:
2014-08-26 15:25:46
阅读次数:
195
1.声明变量 #set($var = XXX) 右边可以是以下的内容 Variable reference String literal Property reference Method reference Number literal #set ($i=1) ArrayList #set ($a...
分类:
其他好文 时间:
2014-08-26 15:07:46
阅读次数:
398
题目大意:给你一个十进制的数字n,然后问你转化为某一进制后它的每一位的数字只可能为3,4,5,6.求这种符合条件的进制有多少种。
解题思路:这题虽然没说进制有多大但是我们可以简单的分析一下,n的上限是10^12,如果有四位数字的话,那至少要出现三次方,所以进制最大为10000。
所以我们枚举一下,一位的时候3,4,5,6显然为-1.
两位的时候解一下a*x+b = n。
三位时解一下:a*...
分类:
其他好文 时间:
2014-08-26 11:38:06
阅读次数:
276
//primenumber
#include<iostream>
usingnamespacestd;
intmain()
{
boolisprime;
cout<<"Primenumber:"<<endl;
for(inti=3;i<=100;i++)
{
isprime=true;
for(intj=2;j<i;j++)
{
if(i%j==0)
isprime=false;
}
if(isprime)
cout<<i<<"isp..
分类:
其他好文 时间:
2014-08-26 03:04:35
阅读次数:
222
原题戳我Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You ha...
分类:
其他好文 时间:
2014-08-26 00:14:25
阅读次数:
334
Run the following command first to start the mongo servermongod run --config /usr/local/etc/mongod.confAssuming you installed mongo usingBrew.More inf...
分类:
数据库 时间:
2014-08-26 00:10:15
阅读次数:
554
Expires 属性 Expires 属性指定了在浏览器上缓冲存储的页距过期还有多少时间。如果用户在某个页过期之前又回到此页,就会显示缓冲区中的版本 语法 Response.Expires [= number] 参数 number 距过期还有多少分钟。将此参数设置为 0 可使缓存的页立即过期。 注释...
分类:
其他好文 时间:
2014-08-26 00:09:05
阅读次数:
195
The string "PAYPALISHIRING" is written in a zigzag pattern on a given
number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
P A H N
A P L S I ...
分类:
其他好文 时间:
2014-08-25 23:00:25
阅读次数:
671