- 博客(5)
- 收藏
- 关注
原创 线性表的链式存储方式
#include<bits/stdc++.h>#define ElemType int #define Status int#define INIt_SIZE 100#define OK 1;#define ERROR 0;using namespace std;typedef struct lnode{ ElemType data; struct lno...
2018-09-28 16:08:30 353
原创 求组合数以及组合数取模
1、采用C(a, b) = n! / (m! * (n - m)!),适用范围为n <= 20typedef long long ll;const int maxn=20+5;ll a[maxn];void init() { a[0]=1; for(int i=1; i<maxn) a[i]=a[i-1]*i;}ll get_c(ll n,ll m) { i...
2018-09-08 15:01:39 460
原创 RMQ和LCA
RMQvoid ST(int n) { for (int i = 1; i <= n; i++) dp[i][0] = a[i]; for (int j = 1; (1 << j) <= n; j++) {//2^j for (int i = 1; i + (1 << j) - 1 <= n; i++) { dp[i][j] = m...
2018-09-06 19:43:11 109
原创 POJ3368-Frequent values(RMQ)
题目大意给出一串数字,求指定区间L-R中出现次数最多的数的次数。分析用a数组表示相同的个数。所以,求出与l相同的个数,和从第一个不和l相同的数到r 直接求AC Code#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using...
2018-09-06 19:39:40 119
原创 HDU 6023-Automatic Judge(模拟题)
分析主要就是多次ac取时间最短的那次。-=和%=1000的问题如果没有ac则罚时不计,都知道的 我却忘考虑了。#include<bits/stdc++.h>using namespace std;const int maxn=1e5+5;struct node{ int id,rtm; string ans,tm;}a[maxn];bool cmp(n...
2018-09-01 11:56:47 171
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人