描述
找出从自然数1、2、... 、n(0<n<10)中任取r(0<r<=n)个数的所有组合。
输入输入n、r。
输出按特定顺序输出所有组合。
特定顺序:每一个组合中的值从大到小排列,组合之间按逆字典序排列。
样例输入
5 3
样例输出
543
542
541
532
531
521
432
431
421
321
//这是关于dfs的,刚开始的是觉得...
分类:
其他好文 时间:
2015-04-27 21:51:38
阅读次数:
124
Max Sum
Time Limit: 2000ms Memory limit: 32768K 有疑问?点这里^_^
题目描述
Given a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, ...
分类:
其他好文 时间:
2015-04-27 21:51:49
阅读次数:
169
题意:
给一个数独的状态,判断它是否合法。
分析:
水,直接判断。
代码:
//poj 3435
//sep9
#include
using namespace std;
const int maxN=10;
const int MAX=maxN*maxN+10;
int a[MAX][MAX];
int col_check[MAX][MAX];
int row_check[MAX][...
分类:
其他好文 时间:
2015-04-27 21:48:38
阅读次数:
135
题目描述
输入一个链表,从尾到头打印链表每个节点的值。返回新链表的头结点。解题思路用栈保存结点指针,先进后出,依次输出出栈的各节点的值。实现代码/**
* struct ListNode {
* int val;
* struct ListNode *next;
* ListNode(int x) :
* val(x), next(NU...
分类:
其他好文 时间:
2015-04-27 21:48:49
阅读次数:
139
Balloons
Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^
题目描述
Both Saya and Kudo like balloons. One day, they heard that in the central park,
there will be thousands of ...
分类:
其他好文 时间:
2015-04-27 21:50:07
阅读次数:
177
互联网职业按大类可分技术类、设计类、产品类、运营类、市场职能类五大类,里面具体的职位,tiger就为大家一一举例分析
技术类
技术类包括web后台开发、前端开发、移动开发、运维、DBA、硬件类的嵌入式开发
后台开发
可简述分为研发工程师、数据分析师、安全工程师、网络工程师、数据挖掘工程师、数据管理/分析工程师、算法工程师、云计算等等,其实这里的很多职位不能划分为后台开发,大...
分类:
其他好文 时间:
2015-04-27 21:50:02
阅读次数:
624
#include
#include
using namespace std;
class Triangle
{
public:
double perimeter();//计算三角形的周长
double area();//计算并返回三角形的面积
void showMessage();
Triangle(double x, double y, double z);
private:...
分类:
其他好文 时间:
2015-04-27 21:48:35
阅读次数:
113
Hello World!
Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^
题目描述
We know that Ivan gives Saya three problems to solve (Problem F), and this is the
first problem.
“We nee...
分类:
其他好文 时间:
2015-04-27 21:49:13
阅读次数:
162
题意:
求n 到 m 的区间范围内不含有4 和 62 的数字个数。 解题思路 与 HDU 3555类似
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
const int MAXN = 10;
int ...
分类:
其他好文 时间:
2015-04-27 21:48:13
阅读次数:
112
Round Robina
Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^
题目描述
Suppose that N players sit in order and take turns in a game, with the first person following the last pe...
分类:
其他好文 时间:
2015-04-27 21:48:03
阅读次数:
126
题目大意:给定字符串A和B,求A最短的子串/子序列S满足S不是B的子串/子序列
这题真TM有毒*2
搞法类似这道题
然后子串是后缀自动机 子序列自然就是序列自动机了= =
每更新一个x节点时所有没有x的后继的节点都连向这个节点
每个节点的parent是这个字母上一次出现的位置
每个字母记录最后一次出现的位置 更新指针时沿着parent指针撸一遍就行了#include
#...
分类:
其他好文 时间:
2015-04-27 21:47:52
阅读次数:
172
#include
#include
using namespace std;
class Triangle
{
public:
double perimeter();//计算三角形的周长
double area();//计算并返回三角形的面积
void showMessage();
Triangle(double x, double y, double z);
private:...
分类:
其他好文 时间:
2015-04-27 21:47:52
阅读次数:
122
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 20161
Accepted: 7532
Description
Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in th...
分类:
其他好文 时间:
2015-04-27 21:46:24
阅读次数:
130
#include
#include
using namespace std;
class Triangle
{
public:
double perimeter();//计算三角形的周长
double area();//计算并返回三角形的面积
void showMessage();
Triangle(double x, double y, double z);
private:...
分类:
其他好文 时间:
2015-04-27 21:47:38
阅读次数:
103
#include
#include
using namespace std;
class Triangle
{
public:
double perimeter();//计算三角形的周长
double area();//计算并返回三角形的面积
void showMessage();
Triangle(double x, double y, double z) :a(x), b(y...
分类:
其他好文 时间:
2015-04-27 21:47:16
阅读次数:
86
题目:打印出所有的 水仙花数 ,所谓 水仙花数 是指一个三位数,其各位数字立方和等于该数本身。
例如:153是一个 水仙花数 ,因为153=1的三次方+5的三次方+3的三次方。
public static void main(String[] args) {
System.out.println(Arrays.toString(getNarcissisticNumbe...
分类:
其他好文 时间:
2015-04-27 21:47:55
阅读次数:
128
网址:https://leetcode.com/problems/add-two-numbers/
题意:
可以用来做大数加法,
从低位开始两两相加,如果大于等于10,则进位
提示:
(1)l1为null 或 l2为null
(2)l1比l2长 或 l2比l1长
(3)l1和l2中的最高位仍然不足以表示两者的和,即需新建结点
解法1:
改变l1的值,
如果l1比l2短,则另接l...
分类:
其他好文 时间:
2015-04-27 21:46:06
阅读次数:
113