题意:给你一个数k,让你输出一个长度为n的数列, 该数列满足 不相等的子序列的个数和为k 关于不相等的定义题中有给出
思路:规律题 当k小于十万时,直接输出k个1,如果题目不要求n的范围 这道题可以都是输出k个1.。。。。
当k大于十万时首先对于一个1到n的数列 它对应的k值为n*(n+1)/2,然后打表 打到45000 就够了,然后再判断表中离k最近切大于k的数是多少,假设为n,我们想办法...
分类:
其他好文 时间:
2015-07-31 18:35:27
阅读次数:
107
要注意的地方就是并不是n*n的矩阵,列要单独求
dfs一下#include
#define LL long long
using namespace std;
const int MAXN = 1e6;
int n,m;
char mp[60][60];
int ans;void dfs_R(int x , int y)
{
if(x >= 0 && x <...
分类:
其他好文 时间:
2015-07-31 16:23:11
阅读次数:
81
Walk Out
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 1794 Accepted Submission(s): 340
Problem Description
In an n?m maze,
...
分类:
其他好文 时间:
2015-07-31 16:20:14
阅读次数:
138
Problem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he asks rikka to have some practice on codeforces. The...
分类:
其他好文 时间:
2015-07-31 16:09:47
阅读次数:
84
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5336
题面:
XYZ and Drops
Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 725 Accept...
分类:
其他好文 时间:
2015-07-31 14:57:30
阅读次数:
620
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5318
题面:
The Goddess Of The Moon
Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 800...
分类:
其他好文 时间:
2015-07-31 14:56:12
阅读次数:
119
http://acm.hdu.edu.cn/showproblem.php?pid=5335
Problem Description
In an n?m maze,
the right-bottom corner is the exit (position (n,m) is
the exit). In every position of this maze, the...
分类:
其他好文 时间:
2015-07-31 14:52:22
阅读次数:
174
Problem Description
XYZ is playing an interesting game called "drops". It is played on a r?c grid.
Each grid cell is either empty, or occupied by a waterdrop. Each waterdrop has a property "size"...
分类:
其他好文 时间:
2015-07-31 12:59:17
阅读次数:
128
题目:http://acm.hdu.edu.cn/showproblem.php?pid=5335
题意:给你N*M的01矩阵,求从(1,1)位置走到(N,M)的最小二进制数,输出不含前导0。
分析:为了不让当前位置向上走,可以先将所有的起点预处理出来。当(1,1)为1,那么起点只有一个,就是(1,1);当(1,1)为0,起点就是从(1,1)可达的并且只走0的这些点,然后把这些起点离终点最近的...
分类:
其他好文 时间:
2015-07-31 10:33:01
阅读次数:
135
??
题意:nXm的地图, 问通过四个方向从(1,1)走到(1000,1000)所经过的最小二进制序列是多少,忽略前缀0.
思路:首先如果起点为0,那么我们bfs搜索和起点0联通的为0的连通块,这样我们第一步肯定是从与这个连通块相邻的且与重点最近的地方出发。
将所有可能起点加入队列,在bfs一遍找到字典序最小的那条路就是答案,
在这里可以用两个vector类型容器,一个是q2存储所有节点值...
分类:
其他好文 时间:
2015-07-31 01:29:07
阅读次数:
451