Problem Description
Once again, James Bond is fleeing from some evil people who want to see him dead. Fortunately, he has left a bungee rope on a nearby highway bridge which he can use to escape fr...
分类:
其他好文 时间:
2015-02-03 09:34:02
阅读次数:
181
题解:
虽然是说有唯一解,但是依然需要在消到某一层时判0/非0,然后适当交换位置。
代码:
#include
#include
#include
#include
#define N 105
#define eps 1e-3
using namespace std;
int n;
double a[N][N],ans[N];
void Gauss()
{
int i,j,k...
分类:
其他好文 时间:
2015-02-03 09:31:05
阅读次数:
222
http://www.lydsy.com/JudgeOnline/problem.php?id=2693题意:求\sum_{i=1}^{n} \sum_{j=1}^{m} lcm(i, j),n,musing namespace std;typedef long long ll;const int ...
分类:
其他好文 时间:
2015-02-03 01:50:40
阅读次数:
238
http://www.lydsy.com/JudgeOnline/problem.php?id=2154题意:求$\sum_{i=1}^{n} \sum_{j=1}^{m} lcm(i, j)$, $n,musing namespace std;typedef long long ll;const ...
分类:
其他好文 时间:
2015-02-03 00:26:59
阅读次数:
216
#include
#include
#include
#include
#include
using namespace std;
class student //创建1个类
{
int no,age;
char name[25],a[20];
public:
void stu(); ...
分类:
其他好文 时间:
2015-02-02 23:23:41
阅读次数:
365
Given an array where elements are sorted in ascending order, convert it toa height balanced BST.
HideTags
Tree Depth-first
Search
#pragma once
#include
#include
using namespace std;...
分类:
其他好文 时间:
2015-02-02 23:14:33
阅读次数:
181
输入不超过1000的正整数n,输出n!=1*2*3*4*···*n的精确结果。样例输入:30样例输出:265252859812191058636308480000000程序:#include #include using namespace std;const int maxn = 3000; //...
分类:
其他好文 时间:
2015-02-02 22:59:36
阅读次数:
225
//poj 3666//分析:只是在2005年集训队论文黄源河提到的题目上略微有一点点变化 1 #include"iostream" 2 #include"cstdio" 3 using namespace std; 4 const int maxn = 2100; 5 int v[maxn],l[...
分类:
其他好文 时间:
2015-02-02 22:45:30
阅读次数:
372
这题就是贪心算法,先对length升序排列,如果length相等,再按weight升序排列;反之亦可。然后根据题目要求进行选择即可。
不过我在写排序函数的时候出了一点问题,害得我还一度以为我的贪心策略是错的。
#include
#include
#include
#include
#include
#include
using namespace std;
const int N=5005;
...
分类:
其他好文 时间:
2015-02-02 21:31:16
阅读次数:
124
1.全局函数和类成员函数转化
全局函数和成员函数的相互转化:只需要修改一个指向本类的this指针;
#include
using namespace std;
class Test
{
public:
Test(int a, int b)
{
this->a = a;
this->b = b;
}
//成员函数
Test &Gadd2(Test &t2)
{...
分类:
编程语言 时间:
2015-02-02 21:29:13
阅读次数:
174