好久不写代码,省赛之后一直在赶作业和复习。对自己还真没什么信心 话说回来试了一下联系赛 三道水题,虽然钱两题很快,但是竟然多敲了几个没用的字符导

int a = 12345678; //格式为sring输出 Label1.Text = string.Format("asdfadsf{0}adsfasdf",a); Label2.Text = "asdfadsf"+a.ToString()+"adsfasdf"; Label1.Text = string.Format("asdfadsf{0:C}adsfasdf"

树状数组模块 ACM个人模板 POJ 2155 题目测试通过 /** * 树状数组模块 * 下标从0开始 */ typedef long DG_Ran; typedef long DG_Num; const DG_Num DG_MAXN = 1005; //2^n DG_Num LowBit(DG_Num n) { return n & (-n); } //获取父节点索引 DG_Num DGFather(DG_Num n)

/** * 线性筛法求素数表 * 复杂度: O(n) */ const long MAXP = 1000000; long prime[MAXP] = {0},num_prime = 0; int isNotPrime[MAXP] = {1, 1}; void GetPrime_Init()//初始化调用 { for(long i = 2 ; i < MAXP ; i ++) { if(!

又是我们的OJ 题目链接: http://www.cn210.com/onlinejudge/problemshow.php?pro_id=92 Description tancu likes space travels but he is a poor software developer and will never be able to buy his own spacecraft. That is why he is preparing to steal the spacecraft of Petru. There is only one problem - Petru has locked the spacecraft with a sophisticated cryptosystem based on the ID numbers of the stars

http://www.cn210.com/onlinejudge/problemshow.php?pro_id=98 我们的OJ Description We say that a set S = {x1, x2, ..., xn} is factor closed if for any xi ∈ S and any divisor d of xi we have d ∈ S. Let's build a GCD matrix (S) = (sij), wheresij = GCD(xi, xj) - the greatest common divisor of xi and xj. Given the factor closed set S, find the value of the determinant:    Input The input contains several test cases. Each test case starts with an integer n (0 < n < 1000), that stands for

链接: http://acm.pku.edu.cn/JudgeOnline/problem?id=1141 题目意思是输入一些括号,补充括号使之成为没有错误的括号就是只能有括号组在括号组里面,不能出现([)]或者([)]一类的情况 方法是DP

这道题是我专门为了了解和学习树状数组而写的 这题用树状数组记录翻转次数,然后mod一个2,也可以不断地取反 还要用到二维的树状数组.于是我专门写