07 2016 档案
摘要:POJ2488 http://poj.org/problem?id=2488 注意字典序。
阅读全文
摘要:http://codeforces.com/group/5pcxnzwAHv/contest/140/problem/A A. New Year Table time limit per test 2 seconds memory limit per test 256 megabytes input
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2717 将每种状态加入到队列中,注意边界条件,n<0&&n>100000 注意N可以比K小,开始没注意,无限wa,还是太菜了啊。。。
阅读全文
摘要:HDU1372 http://acm.hdu.edu.cn/showproblem.php?pid=1372 模板
阅读全文
摘要:Christmas is coming and everyone is building a Christmas tree, and you are no exception. However you are special and you want to build a special one.
阅读全文
摘要:A sequence of positive rational numbers is defined as follows:An infinite full binary tree labeled by positive rational numbers is defined by: The la
阅读全文
摘要:对正整数n,欧拉函数是少于或等于n的数中与n互质的数的数目。例如euler(8)=4,因为1,3,5,7均和8互质。 Euler函数表达通式:euler(x)=x(1-1/p1)(1-1/p2)(1-1/p3)(1-1/p4)…(1-1/pn),其中p1,p2……pn为x的所有素因数,x是不为0的整
阅读全文
摘要:http://codeforces.com/problemset/problem/362/C 1 #include <stdio.h> 2 #include <string.h> 3 #include <algorithm> 4 using namespace std; 5 const int ma
阅读全文
摘要:http://codeforces.com/problemset/problem/362/B 水题。 1 #include<cstdio> 2 #include<iostream> 3 #include<cstring> 4 #include<algorithm> 5 using namespace
阅读全文
摘要:http://codeforces.com/problemset/problem/362/A 题意:两个棋子同时走田字,问是否能相遇。#没什么卵用。 开始没注意两个棋子同时走,当相差距离为2时,不可能相遇。 思路:两个棋子横坐标相差为4或者相差为0时,才可以相遇。纵坐标同理。 1 #include<
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1423 一维数组. 1 #include<stdio.h> 2 #include<string.h> 3 int a[510],b[510]; 4 int dp[510]; 5 int main() 6 { 7 i
阅读全文
摘要:http://poj.org/problem?id=1458 1 #include<cstdio> 2 #include<cstring> 3 #include<iostream> 4 using namespace std; 5 char a[1005],b[1005]; 6 int dp[100
阅读全文
摘要:http://poj.org/problem?id=2533 注意dp[i]是以第i个数为尾数(一定为尾数结尾)的最长上升子序列。 dp[i]=max(dp[j]+1,dp[i])。 dp[n]不一定为最大的,所以要重新扫一遍。从零开始,所以最后要加一。 1 #include<cstdio> 2 #
阅读全文
摘要:http://poj.org/problem?id=2993 模拟大法好。 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 5 char q[10],w[100]; 6 char e
阅读全文
摘要:http://blog.csdn.net/AXuan_K/article/details/37922039 题意:给定一个棋盘,输出个个棋子的位置。行数字表示,列字母表示。 注意:1、大写字母表示白色,小写字母表示黑色,表中的标点并没什么卵用。 2、该棋盘的排序和矩阵的行相反,即矩阵最后一行为棋盘第
阅读全文
摘要:http://poj.org/problem?id=1573 题意:给定一个初始位置,让其在迷宫里走,看是否能走出。能走出就输出所走的步数,否则输出进入循环之前的步数和循环的步数。 思路:用If模拟所走的路线,用for语句,最多走n*m步,如果走出迷宫范围就break。否则,用map数组记录所走的步
阅读全文
摘要:http://poj.org/problem?id=1068 题意:P=每个右括号前面的左括号,W=每个右括号所在的括号包含的完整括号数,包括其本身。已知P,求W。 模拟题,将原括号按照数据呈现出来,用数组记录。 然后用递归求出W,递归的出口为右括号,当为左括号时,对s进行叠加,即所包含的括号数。为
阅读全文

浙公网安备 33010602011771号