随笔分类 - ACM
摘要:B. Internet Addresstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya is an active Internet user. One day he came across an Internet resource he liked, so he wrote its address in the notebook. We know that the address of the written resource h
阅读全文
摘要:We all know that FatMouse doesn't speak English. But now he has to be prepared since our nation will join WTO soon. Thanks to Turing we have computers to help him.Input SpecificationInput consists of up to 100,005 dictionary entries, followed by a blank line, followed by a message of up to 100,0
阅读全文
摘要:1查找 #####2 记a,b,c,d为距中心点的距离3 如果a=b=c=d,在判断组成的cross的#号的上下左右没有#号View Code 1 #include<iostream> 2 #include<string> 3 #include<stdio.h> 4 using namespace std; 5 int n; 6 char map[60][60]; 7 int judge(int x,int y) 8 { 9 int a,b,c,d; 10 int j; 11 a=b=c=d=0; 12 for(j=y-1;j>=1;j--)...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3123题目给出的n很大,很明显如果n很大时,是不用处理到n的,所以其中必有蹊跷!当n大于m时 ,n的阶乘中必定包含因数m,所以取余后必定为0;这是本体的关键。View Code 1 #include<stdio.h> 2 #include<string.h> 3 int main() 4 { 5 __int64 ans,sum,temp,max; 6 char str[150]; 7 int t,m,len; 8 int i; 9 scanf("%d",&t
阅读全文
摘要:The usage of getline();#include<iostream>#include<map>#include<string>using namespace std;int main(){ int n; cin>>n; int p=1; while(n--) { int num; string str; cin>>num; getchar(); getline(cin,str); int m; int a[600]; cin...
阅读全文
摘要:Problem link adress:click hereThis isabasic BFS problem.But the way of knight'smove is strange,if you don't know the law of the knight's move,you are likely to cann't work the problem out.However,if you can find the regularity of the problem from the given cases's data,you must b
阅读全文
摘要:Problem link adress :hdu 4460Problem analysis:For this problem,first give you some people's name and then give you the relations of them.Now,you task is calculate the maximum steps between the every two guys.To solve the problem,you just need to calculate all the steps between the every two guys
阅读全文
摘要:A very hard Aoshu problemProblem DescriptionAoshu is very popular among primary school students. It is mathematics, but much harder than ordinary mathematics for primary school students. Teacher Liu is an Aoshu teacher. He just comes out with a problem to test his students: Given a serial of digits,
阅读全文