一开始想多了,以为应该做个数位dp的,后来想了想也不过100W的数据,直接暴力好像也不慢,于是暴力就过了,还挺快。 1 #include 2 using namespace std; 3 4 bool judge( int x, int d ) 5 { 6 while ( x ) 7 ...
分类:
其他好文 时间:
2015-04-16 23:30:17
阅读次数:
148
用三角形面积什么的算算点到直线的距离之类……其实相切的情况是可行的……剩下的就跟某SDOI2015一样了。#include#include#include#include#includeusing namespace std;#define N 201#define EPS 0.000001#def...
分类:
Web程序 时间:
2015-04-16 23:22:20
阅读次数:
200
(1)阅读下面的程序,体会注释中的说明。//例:使用成员函数、友元函数和一般函数的区别
#include
using namespace std;
class Time
{
public:
Time(int h,int m,int s):hour(h),minute(m),sec(s) {}
void display1(); //display1是成员函数
frie...
分类:
其他好文 时间:
2015-04-16 22:02:28
阅读次数:
149
本文利用邻接表的方法将图进行了表示,并且利用广度优先遍历方法对图进行遍历
下面是一个图的示例:
代码如下:
#include
using namespace std;
typedef int VexType;
typedef struct Arcnode{
VexType data;
struct Arcnode *nextarc;
}ArcNode;
typedef...
分类:
编程语言 时间:
2015-04-16 21:59:52
阅读次数:
186
#include
#include
#include
#define M 300000
#define inf 0x3f3f3f3f
using namespace std;
int maxx,minn;
long long sum;
int r,c,m;
struct T
{
int left,right,min,max,sum;
int add,set;
}tree[M];
s...
分类:
其他好文 时间:
2015-04-16 21:59:46
阅读次数:
152
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3829
#include
#include
#include
#include
#include
using namespace std;
#define M 510
#define N 250010
int Head[M], Next[N], Key[N];
int match[M];
stri...
分类:
其他好文 时间:
2015-04-16 21:57:38
阅读次数:
200
1 #include 2 #include 3 #include 4 #include 5 6 #define LCHILD '0' 7 #define RCHILD '1' 8 9 using namespace std; 10 11 char ans[1000][50...
分类:
其他好文 时间:
2015-04-16 21:45:36
阅读次数:
132
题目地址:http://acm.csu.edu.cn/OnlineJudge/problem.php?id=1553#include #include #include using namespace std;int main(){ long long int a[10005],n,k; ...
分类:
其他好文 时间:
2015-04-16 21:36:35
阅读次数:
99
#include#include#includeusing namespace std;class poly{public: double c; int e; poly*next;};poly*input();double f(poly*head,double x);double root(poly...
分类:
其他好文 时间:
2015-04-16 21:32:02
阅读次数:
150
1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 int main(void) 8 { 9 vector vecStr;10 vecStr.push_back("hello");11 vec...
分类:
其他好文 时间:
2015-04-16 21:31:05
阅读次数:
120