现在位置: 首页 > axon发表的所有文章
  • 09月
  • 13日
综合 ⁄ 共 246字 评论关闭
#include <stdio.h> int main() { int a[1000],m,n,i,j,c,t; while(scanf("%d",&n)!=EOF) { a[0]=1; m=1; for(i=2;i<=n;i++) { for(c=0,j=0;j<m;j++){ t=a[j]*i+c; a[j]=t%10; c=t/10; } while(c){ a[m++]=c%10; c/=10; } } for(j=m-1;j>=0;j--) printf("%d",a[j]); printf("\n"); } return 0; }  
阅读全文
  • 05月
  • 27日
综合 ⁄ 共 154字 评论关闭
move: usually used for draggable elements help: indicates that help is available pointer: the default cursor hover links text: the default cursor for inputs and texts crosshair wait
阅读全文
  • 04月
  • 23日
综合 ⁄ 共 1808字 评论关闭
 Cube painting  We have a machine for painting cubes. It is supplied with three different colors: blue, red and green. Each face of the cube gets one of these colors. The cube's faces are numbered as in Figure 1. Figure 1. Since a cube has 6 faces, our machine can paint a face-numbered cube in  different ways. When ignoring the face-numbers, the number of different paintings is much less, because a cube can be rotated. See example below. We denote a painted cube by a string of 6 ch......
阅读全文
  • 01月
  • 19日
综合 ⁄ 共 837字 评论关闭
Primes Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 921    Accepted Submission(s): 420 Problem Description Given a number n, please count how many tuple(p1, p2, p3) satisfied that p1<=p2<=p3, p1,p2,p3 are primes and p1 + p2 + p3 = n. Input Multiple test cases(less than 100), for each test case, the only line indicates the positive integer n(n≤10000). Output For each test case, print the number of ways. Sample Input ......
阅读全文
  • 11月
  • 22日
综合 ⁄ 共 988字 评论关闭
Sum Sum Sum Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 146    Accepted Submission(s): 108 Problem Description We call a positive number X P-number if there is not a positive number that is less than X and the greatest common divisor of these two numbers is bigger than 1. Now you are given a sequence of integers. You task is to calculate the sum of P-numbers of the sequence. Input There are several test cases. In each test ......
阅读全文
  • 11月
  • 22日
综合 ⁄ 共 3553字 评论关闭
有n堆石子,每次可以从第1堆石子里取1颗、2颗或3颗,可以从第2堆石子里取奇数颗,可以从第3堆及以后石子里取任意颗……这时看上去问题复杂了很多,但相信你如果掌握了本节的内容,类似的千变万化的问题都是不成问题的。 现在我们来研究一个看上去似乎更为一般的游戏:给定一个有向无环图和一个起始顶点上的一枚棋子,两名选手交替的将这枚棋子沿有向边进行移动,无法移动者判负。事实上,这个游戏可以认为是所有Impartial Combinatorial Games的抽象模型。也就是说,任何一个ICG都可以通过把每个局面看成一个顶点,对每个局面和它的......
阅读全文
  • 11月
  • 21日
综合 ⁄ 共 730字 评论关闭
今天撸了一天的状态压缩DP。。。。。 。。。没有然后了。。。感觉稍有些思路了,,,但是不知道为什么这道题答案出不来,感觉自己在DP的初始化上面还有些问题。。。 先挂着代码吧。。。 #include <stdio.h> #include <string.h> int dp[13][5000],que[13],map[13]; int ok(int x) { if(x&(x<<1)) return 0; return 1; } int max(int x,int y) { if(x>y) return x; else return y; } int main() { int n,m; while(scanf("%d%d",&n,&m)!=EOF) { int i,j,k; ......
阅读全文
  • 11月
  • 10日
综合 ⁄ 共 2109字 评论关闭
汪宪博 发布于 2012年07月12日 17时 http://www.oschina.net/code/snippet_584980_11834 C#调用Rar文件以及获取Rar返回值。 适用于C#调用。 所需的Rar.exe可从WinRar官网下载控制台版。 也可以直接下载:http://public.myluoluo.com/u/85142505/ProgramFile/Rar.exe System.Diagnostics.Process process;         private void btnRAR_Click(object sender, EventArgs e)         {             if (System.IO.File.Exists("Rar.exe"))             {                 try                 {                     process = new S......
阅读全文
  • 10月
  • 21日
综合 ⁄ 共 1940字 评论关闭
用python的异常处理和日志可以完整的记录程序发生异常时的出错信息。 这有赖于logging模块的强大和python的错误处理机制。 以下是代码,参考了http://stackoverflow.com/questions/3702675/print-the-full-traceback-in-python-without-halting-the-program 基本范式是: try:     do-something-block except:     logger.exception("Exception Logged") def setLogger(): # 创建一个logger,可以考虑如何将它封装 logger = logging.getLogger('mylogger') logger.setLevel(logging.DEBUG) # 创建一个handle......
阅读全文
  • 10月
  • 15日
综合 ⁄ 共 3294字 评论关闭
Problem B: The Largest Clique Given a directed graph G, consider the following transformation. First, create a new graphT(G) to have the same vertex set as G. Create a directed edge betweentwo vertices u and v in T(G) if and only if there is a pathbetween u and v in G that follows the directed edges only in the forwarddirection. This graph T(G) is often called the transitive closure of G. We define a clique in a directed graph as a set of vertices U such thatfor any two vertices u and ......
阅读全文
  • 10月
  • 12日
综合 ⁄ 共 1150字 评论关闭
题目描述:     堆栈是一种基本的数据结构。堆栈具有两种基本操作方式,push 和 pop。Push一个值会将其压入栈顶,而 pop 则会将栈顶的值弹出。现在我们就来验证一下堆栈的使用。 输入:      对于每组测试数据,第一行是一个正整数 n,0<n<=10000(n=0 结束)。而后的 n 行,每行的第一个字符可能是'P’或者'O’或者'A’;如果是'P’,后面还会跟着一个整数,表示把这个数据压入堆栈;如果是'O’,表示将栈顶的值 pop 出来,如果堆栈中没有元素时,忽略本次操作;如果是'A’,表示询问当前栈顶的值,如果当时栈为空,则输出'E'。......
阅读全文
  • 10月
  • 04日
综合 ⁄ 共 8089字 评论关闭
        学习OpenGL(五)颜色、光照与材质 kezunhai@gmail.com http://blog.csdn.net/kezunhai            颜色、光照和材质是OpenGL的重要内容,其中glColor函数设置当前的颜色,该函数之后绘制的所有顶点(图形)都使用该颜色。对于一个点,其颜色就是设置的颜色,而对于一条直线而言,如果两个顶点的颜色不同,那么两点之间线的颜色取决于阴暗(Shade)处理的模型。明暗处理的定义就是从一种颜色到另一种颜色的平滑过滤。           光滑的明暗处理(GL_SMOOTH)让颜色沿着直线变动,就像RGB颜色立方体中一个颜色......
阅读全文