一 题意描述:给你N(1 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 const int N = 10000 + 10; 8 const int K = 100 + 10; 9 bool f[N][...
分类:
其他好文 时间:
2014-07-22 00:32:38
阅读次数:
207
这个题目好果的01,只要把每个数乘以100,就能解决下标的问题了
继续贴代码环节(自己的代码好丑啊~~~)
#include
#include
#include
#include
#define maxn 3100000
using namespace std;
int dp[maxn];
int p[31];
int main()
{
double Q;
int n,...
分类:
其他好文 时间:
2014-07-22 00:32:35
阅读次数:
213
冒泡排序代码:
#include
#include
using namespace std;
template
void bubbleSort(ItemType theArray[], int n)
{
bool sorted = false; // False when swaps occur
int pass = 1;
while (!sorted && (pass...
分类:
其他好文 时间:
2014-07-22 00:32:35
阅读次数:
363
用G++过了,c++无限WA
就是一水,就是求输入的字符串中是否有一个是其他字符串的子串;
注意这种数据。。。
0000
010
01
9
字符串的长度从大到小;
#include
#include
#include
using namespace std;
char qq[20005];
struct node{
int q[2];
int w;
node...
分类:
其他好文 时间:
2014-07-22 00:30:36
阅读次数:
192
UVA 684 - Integral Determinant
题目链接
题意:给定一个行列式,求出值
思路:利用线性代数中的列相减,然后不断降阶即可,就是要用分数去写
代码:
#include
#include
#include
using namespace std;
const int N = 35;
long long gcd(long long a...
分类:
其他好文 时间:
2014-07-22 00:26:37
阅读次数:
207
题意就是一颗星星的左下方有多少颗星星就是几级;
把每级的星星个数统计好输出就ok;
但不能用二维树状数组,会超内存,,
#include
#include
#include
#define maxn 32001
using namespace std;
int a;
int arr[maxn];
int low(int x)
{
return x&(-x);
}
void u...
分类:
其他好文 时间:
2014-07-21 13:38:26
阅读次数:
213
# include
# include
# include
using namespace std;
struct node
{
int pos;
int d;
int num;
friend bool operator n2.d;//仍的距离从小到大
return...
分类:
其他好文 时间:
2014-07-21 11:43:44
阅读次数:
180
虽然很多人说记模板提升空间有限,但是对于我这种菜鸟级别的人来说。能做的也只有记记模板了!
希望这个模板能帮到你,如果有更好的模板记得告诉我哦!!谢谢。
二维代码:
#include
#include
#include
using namespace std;
int n,m,a[505],b[505],dp[505][505];
int LICS()
{
int max,i,j;
mem...
分类:
其他好文 时间:
2014-07-21 11:42:44
阅读次数:
192
# include
# include
# include
using namespace std;
struct node
{
int y;
int val;
int num;
friend bool operatorn2.num;//从小到大
return...
分类:
其他好文 时间:
2014-07-21 11:36:44
阅读次数:
203
一般情况:
#include
#include
#include
using namespace std;
int a[1005],dp[1005],n;
int LIS()
{
int i,j,ans,m;
dp[1] = 1;
ans = 1;
for(i = 2;i<=n;i++)
{
m = 0;
for(...
分类:
其他好文 时间:
2014-07-21 11:23:15
阅读次数:
185