自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 收藏
  • 关注

原创 Sitting In The Line(百度之星初赛, 超能力Coding 4370)

#include <iostream>#include <cstdio>using namespace std;int a[100010];int p[29];int dp[1 << 20][20];int b[29];const int inf = 1500000000;void checkmax(int & a, const int & b){ if(b > a) a = b;}int main(){

2022-03-31 17:53:47 63

原创 TSP问题

TSP问题 (POJ3311/HDU5067/HDU5418/HDU1217)采用 POJ3311POJ3311POJ3311 的题面DescriptionThe Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the

2022-03-31 17:25:30 114

原创 SP26777

#include <iostream>#include <cstdio>using namespace std;const int N = 1e6+10, mod = 1e9+7;long long C[N], S[N];signed main() { for (int i = 1; i <= 1000000; i ++) C[i] = (1LL * (i - 1) * (i - 2) / 2) % mod, S[i] = (S[i -

2022-03-31 13:34:34 75

原创 SP1437

【树形DP学习笔记】【模板题】树的直径**题目简述:**给定一棵树,有 nnn 个点和 n−1n-1n−1 条边,求这棵树上的任意两个点的距离的最大值。2≤n≤1052\le n\le 10^52≤n≤105,1≤ai<bi≤n1\le a_i < b_i\le n1≤ai​<bi​≤n,1≤ci≤1041\le c_i\le 10^41≤ci​≤104题解:任取一点 uuu 作为起点,找到距离这个点的最短的一个点 v1v_1v1​。找到距离 v1v_1v1​ 最远的一个点 v2

2022-03-17 16:50:11 88

原创 CodeForces 176B

#include <bits/stdc++.h>using namespace std;int dp[5555][5555];signed main() { int n__; cin >> n__; string s; cin >> s; string t = s; reverse (t.begin(), t.end()); int n = s.length(); for (int i = n;

2022-03-16 17:05:26 67

原创 P5842

#include <iostream>#include <cstdio>#include <cstring>#define int long long // QAQ_QWQusing namespace std;const int MOD = 20120427, isoprene_jvruoMOD = 1000037, N = 66062;#define ll long longint head[isoprene_jvruoMOD + 50], n

2022-03-15 17:45:05 72

原创 P3413

#include <iostream>#include <cstdio>#include <cstring>using namespace std;const int mod = 1000000007;long long f[10030][2][10][10][2];int n = 0, c[10030];long long calc(long long x) { // int n = 0; // int c[30] {};

2022-03-10 17:39:36 195

原创 SP10790

// usename: lxylluvio// Date: 2022/03/09 10:06// Remote Judge from Luogu.#include <iostream>#include <cstring>#include <cstdio>#define st(f,x) memset (f, x, sizeof f);using namespace std;bool b[210];inline void sieve(bool *a

2022-03-09 10:11:15 52

原创 最长上升公共子序列问题求解

#include <iostream>#include <cstring>#include <algorithm>using namespace std;const int N = 3010;int n;int a[N], b[N];int f[N][N];int main(){ int n; cin >> n; for (int i = 1; i <= n; i ++) scanf ("%.

2021-10-27 08:54:35 75

原创 Usaco 1.2 断掉的项链

#include <iostream>#include <cstring>#include <algorithm>using namespace std;inline int get(char c){ return c == 'b' ? 1 : 2; }int main(){ int n; string s; cin >> n >> s; s += s; int res = 0;

2021-10-25 12:35:57 74

原创 Bzoj 2396. 神奇的矩阵

rand函数:生成随机数srand(time(0)): 生成随机数种子Miller_rabin思想#include <stdio.h>#include <stdlib.h>#include <time.h>#include <stdbool.h>const int N = 1010;int a[N][N], b[N][N], c[N][N], d[N][N];int e[N][N], f[N][N];int g[N][N], h[N][N

2021-10-24 11:12:21 94

原创 Bzoj 2969 矩阵粉刷

思想:期望,概率#include <bits/stdc++.h>using namespace std;double P[1010][1010];const double eps = 1E-9;double quick_power(double a, int b){ if (b == 0) return 1; double ans = quick_power(a, b >> 1); ans = ans * ans; i.

2021-10-24 10:28:04 149 1

原创 CSPJ考前必会

考前必会知识点CSPJ文章目录CSPJ1. `dijkstra`算法的堆优化实现2. `Bellman_ford`算法3. `Kruskal`算法4. `STL`基本操作5. `floyd`算法6. 拓扑排序7. 哈希表1. dijkstra算法的堆优化实现struct node{ int u, dis; inline bool operator < (const node & cmp2) const { return dis > cmp

2021-10-22 20:32:34 415

原创 试机-Hello world

Hello, world!print ('hello, World!')

2021-10-17 16:38:06 52

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除