题目链接:hdu 3269 Convex
题目大意:给出n个点,问任选四个点可以组成多少个凸四边形。
解题思路:和uav11529的做法是一样的,只不过求的东西不一样。
#include
#include
#include
#include
#include
using namespace std;
typedef long long ll;
const int N =...
分类:
其他好文 时间:
2014-05-25 18:38:17
阅读次数:
155
哎,本来是想学学矩阵构造的方法的,,突然发现自己不用看直接就会yy构造。。。
看下右边有什么。。
题目地址:Another kind of Fibonacci
AC代码:
#include
#include
#include
#include
using namespace std;
const int mod=10007;
int p[4][4],a[4][4],tmp...
分类:
其他好文 时间:
2014-05-25 18:23:49
阅读次数:
268
我们经常会用到平年和闰年对应的天数,直接对数组静态初始化固然可以,但是手写起来很容易写错,所以用个函数得对应天数。
完整代码:
#include
using namespace std;
int count = 0;
int a[2][12];
void init_arr(int a[2][12])
{
for(int i=0;i<13;i++)
{
if(i==1||i==3||i=...
分类:
其他好文 时间:
2014-05-25 18:16:39
阅读次数:
258
题目:
链接:点击打开链接
题意:
n个课程m天完成,a[i][j]表示用j天完成第i个课程得到的价值,求最大价值。
算法:
分组背包。
思路:
m天是总容量,n是组数。
代码:
#include
#include
#include
using namespace std;
int n,m;
int a[110][...
分类:
其他好文 时间:
2014-05-25 18:16:18
阅读次数:
223
题目来源:POJ 2019 Cornfields
题意:求正方形二维区间最大最小值的差
思路:直接二维ST搞 试模版而已
#include
#include
#include
using namespace std;
const int maxn = 255;
int dp[maxn][maxn][8][8];
int dp2[maxn][maxn][8][8];
int a[...
分类:
其他好文 时间:
2014-05-25 10:21:07
阅读次数:
246
使用 Shark 来对你的 iPhone 应用进行性能调优(Using Shark to Performance Tune Your iPhone App)...
分类:
移动开发 时间:
2014-05-25 08:57:34
阅读次数:
355
哈希表简单实现,练个手
#include "stdafx.h"
#include
using namespace std;
#define HASHSIZE 12
typedef struct HashTable
{
int *elem;
int count;
}HashTable;
int m = 0;
void Print(HashTable* ...
分类:
其他好文 时间:
2014-05-25 07:02:06
阅读次数:
169
题目来源:Light OJ 1234 Harmonic Number
题意:
思路:没思路啊 这个是高数的东西 发散 n足够大时它无穷大 直接公式解
#include
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 1000010;
const doub...
分类:
其他好文 时间:
2014-05-25 06:18:44
阅读次数:
213
sg[0]=0;sg[i]=mex{sg[i-2^(j)]}
(i>=2^j)mex()为不在此集合的最小非负整数#include #include #include #include using namespace
std;using namespace std;int main(){ in...
分类:
其他好文 时间:
2014-05-25 03:27:01
阅读次数:
170
很少用bfs进行最短路搜索,实际BFS有时候挺方便得,省去了建图以及复杂度也降低了O(N*M);UVA 11624 写的比较挫#include #include
#include #include using namespace std;struct node{ int ft; int ...
分类:
其他好文 时间:
2014-05-25 03:23:54
阅读次数:
210