#include<stdio.h> struct AC { int x,y; }a[1000004]; int main() { int i,j,k=0;a[125].x=1,a[521].y=1; for(i=0; i<1000003; i++) { int c[3]={0}; if(i%10==5||i%100/10==5||i%1000/100==5||i%10000/1000==5||i%100000/10000==5||i%1000000/100000==5) c[2]=1;…
#include<stdio.h> #include<stdlib.h> //快速幂算法,数论二分 long long powermod(int a,int b, int c) //不用longlong就报错,题目中那个取值范围不就在2的31次方内 { long long t; if(b==0) return 1%c; if(b==1) return a%c; t=powermod(a,b/2,c);//递归调用,采用二分递归算法,,注意这里n/2会带来奇偶性问题 t=t*t%c;…
Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can't move on red tiles, he can move only…
假如你也是一个java程序员,而你又不是很懂Socket. 下面我的这篇文章也许能帮助你一些. http://xiva.iteye.com/blog/993336 首先我们写好上面文章中的server端. 下面我们可以访问一下下面的地址: http://code.google.com/p/cocoaasyncsocket/ 这是一个开源框架.呵,不知道拿到自己程序中使用是否涉及侵权. 但是这句话"The CocoaAsyncSocket project is in the public doma…