题意:找区间美丽数(自身有不同数字组成的数,如123是,100不是)的个数
思路:打表#include
#define LL long long
using namespace std;
int a[1001005];
int n;
int f[100005];
int sum[100005];
int flag[10];void init()
{
for(...
分类:
其他好文 时间:
2015-07-31 21:59:56
阅读次数:
130
#include
#include
#include
#include
using namespace std;
typedef struct student
{
int data;
struct student *next;
}node;
node *creat()
{
node *head, *p, *s;
int x, cycle = 1;
head = ...
分类:
其他好文 时间:
2015-07-31 21:59:13
阅读次数:
111
using System;namespace Test{ class Test1 { static void Main(string[] args) { string str1 = "123"; string str2 = str1; str1 = "456"; Console....
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include using namespace std;
#def...
分类:
其他好文 时间:
2015-07-31 21:53:47
阅读次数:
101
题目传送门 1 /* 2 矩阵快速幂:求第n项的Fibonacci数,转置矩阵都给出,套个模板就可以了。效率很高啊 3 */ 4 #include 5 #include 6 #include 7 #include 8 using namespace std; 9 10 const i...
分类:
其他好文 时间:
2015-07-31 21:48:15
阅读次数:
114
直接T了,居然可以这么剪枝题解链接:点我 1 #include 2 #include 3 #include 4 #define ll __int64 5 using namespace std; 6 ll a[23],x[23][5],ans; 7 mapp; 8 void dfs(int d,in...
分类:
其他好文 时间:
2015-07-31 21:41:31
阅读次数:
122
这题题意是 给了n个城市 在其中小于等于k个城市建立机场然后 使得最远的那个离机场的城市距离最短二分答案 ,我们对于每次的mid 重新建图然后再来一次DLX,每个点可以覆盖的点建立一条联系就ok了#include #include #include #include #include using n...
分类:
其他好文 时间:
2015-07-31 21:39:48
阅读次数:
138
字符串中各单词的翻转// 字符串中各单词的翻转.cpp : 定义控制台应用程序的入口点。
//#include "stdafx.h"
#include
#include
using namespace std;void RevStr(char* src)
{
char *start=src,*end=src,*ptr=src;
while(*...
分类:
其他好文 时间:
2015-07-31 20:29:07
阅读次数:
172
我自定义了一个模板类并重载了运算符,预定义实现功能为能实现对数组一般操作,类似于vector。
#ifndef ARRAY_H
#define ARRAY_H
#include
using namespace std;
template
class Array{
friend ostream& operator<<(ostream&, const Array &);
friend i...
分类:
其他好文 时间:
2015-07-31 20:23:16
阅读次数:
108
//n列个座位,排数为无穷
//m个询问
//a,b,x ,a在b前面x列
//问这m个询问与其前面询问冲突的有多少个
//带权并查集存下每个点到这个集合中最前的距离
#include
#include
#include
using namespace std ;
const int maxn = 50010 ;
int F[maxn] ;
i...
分类:
其他好文 时间:
2015-07-31 20:20:50
阅读次数:
104