问题:
此题需要用到大数来储存,但int还是能装下输入的n,m所以并没必要用BigInteger来装。
在开始用BigInteger装n时,即使将0转化成BigInteger型,用于判断0的if语句并没有效果,原因不明。
一些用于处理大数的函数:
Ⅰ基本函数:
1.valueOf(parament); 将参数转换为制定的类型
比如 int a=3;
BigIn...
分类:
编程语言 时间:
2015-05-28 12:40:42
阅读次数:
129
没说的,水
#include
#include
using namespace std;
int factorial(int n)
{
if(n==1||n==0)
return 1;
else
return n*factorial(n-1);
}
int main()
{
cout<<"n e"<<endl;
cout<<"...
分类:
其他好文 时间:
2015-05-28 12:39:03
阅读次数:
185
题意:n个点m次操作,每次操作给出c,a,b;若c为‘Q’,则查询【a,b】区间最大值;若c为‘U’,将第a个点更新为b;思路:线段树单点更新,区间求极值;#include#include#includeusing namespace std;int n,m;int tree[5000010];in...
分类:
其他好文 时间:
2015-05-28 12:33:23
阅读次数:
156
一、冒泡排序趟数和次数:每趟出来一个最小(最大)的数。每次比较相邻的两个数,按要求交换位置。 int[] a = new int[8] { 9, 21, 8, 13, 16, 22, 7, 6 }; Console.WriteLine("************排序之前****...
分类:
编程语言 时间:
2015-05-28 12:27:57
阅读次数:
109
【转】http://blog.chinaunix.net/uid-21411227-id-1826986.html一.逻辑运算符 1.& 位与运算 1) 运算规则 位与运算的实质是将参与运算的两个数据,按对应的二进制数逐位进行逻辑与运算。例如:int型常量4和7进行位与运算的运算过程如下:4=0.....
分类:
其他好文 时间:
2015-05-28 12:27:04
阅读次数:
179
因为我们的应用中处理的记录都是固定长度的,就是说所有数据都是由固定长度的记录构成的。这里用recordSize表示一个记录的大小,记录在处理处理过程中要保持完整性,所以在设置Split大小时,开始的实现代码为:int blockSize = Integer.parseInt(args[0]); //...
分类:
其他好文 时间:
2015-05-28 12:20:13
阅读次数:
161
XE7System.UnicodeString.IsLeadSurrogatebool IsLeadSurrogate(int index)Tests whether the element is a lead surrogate.IsLeadSurrogate returns true if th...
分类:
其他好文 时间:
2015-05-28 12:20:02
阅读次数:
143
sscanf()函数用于从字符串中读取指定格式的数据,其原型如下: int sscanf (char *str, char * format [, argument, ...]);【参数】参数str为要读取数据的字符串;format为用户指定的格式;argument为变量,用来保存读取到的数据。【....
分类:
编程语言 时间:
2015-05-28 12:07:56
阅读次数:
173
import java.lang.StringBuilder; public class Stringadd { ?public static void method1() { ??String[] name = { "嘿嘿", "嘻", "等等等" }; ??StringBuffer sb = new StringBuffer(); ??for (int i = ...
分类:
编程语言 时间:
2015-05-28 11:06:02
阅读次数:
168
方程都给出来了,直接敲代码就好了。
#include
#include
#include
using namespace std;
int dp[25][25][25];
int dfs(int a,int b,int c)
{
if(a<=0 || b<=0 || c20 || b>20 || c>20)...
分类:
其他好文 时间:
2015-05-28 10:59:29
阅读次数:
135