在空间中的n(n为偶数)个点,配成n对,然后使得每一个点在一个点对中。所有的点对的距离之和最小
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define INF 100000000
using namespace std;
int n;...
分类:
其他好文 时间:
2015-04-30 10:46:30
阅读次数:
118
#include
#include
#include
using namespace std;
struct node
{
char name[90],place[90];
int num;
}c[105];
bool cmp(node x,node y)
{
if(strcmp(x.place,y.place)<0) return true;
if(strcmp(x.place,...
分类:
编程语言 时间:
2015-04-30 10:39:46
阅读次数:
162
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WyfClass { public class tools { /// /// 得到...
当增加新元素(s)时,如果超过当时的容量,则容量会扩充至两倍。如果两倍容量仍不足,就扩张至足够大的容量。
以一个例子来说明:
#include
#include
#include
using namespace std;
int main()
{
int i;
vector iv(2,9);
cout<<"size = "<<iv.size()<<endl;
...
分类:
其他好文 时间:
2015-04-30 09:05:42
阅读次数:
116
#include
#include
#include
using namespace std;
int main()
{
// 数组大小为7
int myInts[] = {10,20,30,40,50,60,70};
// 容器大小为8,里面有8个7
vector myVector(8,7);
// 1.将数组中的7个数复制到容器的第一个位置,将覆盖容...
分类:
编程语言 时间:
2015-04-30 09:03:50
阅读次数:
183
题目传送:福州大学第十届程序设计竞赛
Problem A 神庙逃亡
水题
AC代码:
#include
#include
#include
using namespace std;
int s, h, vx, vy;
int main() {
int w;
cin >> w;
while(w--){
cin >> s >> h >> v...
分类:
其他好文 时间:
2015-04-30 08:57:23
阅读次数:
133
发现自己还是看书少了,能从书上学到不少东西。
加减乘的模运算:
#include
using namespace std;
int mul_mod(int a,int b,int n){
a %= n; b %= b;
return (int)((long long)a * b % n);
}///如果n本身超int,就要用高精度了
int add_mod(int a,int ...
分类:
其他好文 时间:
2015-04-30 08:53:44
阅读次数:
185
原题地址不知道为什么要用动态规划做,明明是扫几遍就行了啊HackerRank上的题目特别喜欢long long类型啊,不用就爆。。代码: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std...
分类:
其他好文 时间:
2015-04-30 07:34:53
阅读次数:
124
https://www.adayinthelifeof.nl/2010/12/04/about-using-utf-8-fields-in-mysql/I sometimes hear: “make everything utf-8 in your database, and all will be...
分类:
数据库 时间:
2015-04-30 07:34:45
阅读次数:
182
1.ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)首先尝试:delete from mysql.user where user is NULL or user='';commit;...
分类:
数据库 时间:
2015-04-30 07:30:23
阅读次数:
189