ICode9

精准搜索请尝试: 精确搜索
  • Note -「最大权闭合子图」做题随笔2021-12-11 13:01:16

    T1 小 M 的作物 先从简化题目入手,考虑先去掉 \(c\) 的额外收益。然后尝试将所有作物种在 \(B\), 则目前得到了 \(\sum \limits_{i = 1} ^n b_i\) 的收益。 接下来我们将每一个作物 \(i\) 分成两个物品,收益分别为 \(a_i,-b_i\),且规定如果想要选收益为 \(a_i\) 的物品,则一定也要选收

  • NSUOJ2877 KMP裸题(字符串哈希或kmp)2021-07-14 09:29:31

    一、题目描述 Description 我们都知道哈希是一个很有趣的数据处理方式,尤其是水题的时候23333。 比如我们可以使用哈希加二分在nlogn的复杂度下解决O(n)的马拉车题目, 再比如我们可以在同样O(n)的复杂度下解决一部分KMP问题, 再比如我们可以在O(nlognlogn)的复杂度下解决O(nlogn)的后缀

  • 常用裸题模板2021-01-09 16:05:25

    常用垃圾题黑题模板 长度,是难度的一部分. 快速排序 #include<bits/stdc++.h> using namespace std; #define maxn 100000 #define read(x) scanf("%d",&x) int n; int a[maxn+5]; int main() { read(n); for(int i=1;i<=n;i++) read(a[i]); sort(a+1,a+n+1); for(i

  • POJ2367(拓扑排序裸题2019-11-23 16:55:14

    1 #include<iostream> 2 #include<vector> 3 #include<queue> 4 using namespace std; 5 typedef long long ll; 6 const int N = 150; 7 int in[N],n,r; 8 vector<int>ans; 9 vector<int>edge[N]; 10 priority_queue<int,vector&l

  • HDU 2063 过山车(二分图最大匹配裸题)2019-09-11 17:03:07

    http://acm.hdu.edu.cn/showproblem.php?pid=2063 因为要补某一道cf题特意来学一下。。。 匈牙利算法关键在于在能“反悔”的时候尽量“反悔”进行新的匹配以获得更多的匹配数。具体建议看代码很好看懂~ 1 #define bug(x) cout<<#x<<" is "<<x<<endl 2 #define IO std::ios::syn

  • poj 2653 线段相交裸题(算法描述)2019-07-17 13:53:43

    #include<stdio.h>#include<math.h>const double eps=1e-8;int n;int cmp(double x){ if(fabs(x)<=eps)return 0; if(x<0)return -1; return 1;}struct Point{ double x,y; Point (){} Point (double _x,double _y) { x=_x;

  • poj2019 二维RMQ裸题2019-07-15 17:54:48

    Cornfields Time Limit: 1000MS   Memory Limit: 30000K Total Submissions:8623   Accepted: 4100 Description FJ has decided to grow his own corn hybrid in order to help the cows make the best possible milk. To that end, he's looking to build th

  • BZOJ 2836 魔法树 链剖裸题~~2019-04-22 13:38:57

    正好练练熟练度。。(刷水题谋财害命QAQ) #include<cstdio>#include<iostream>#define ll long long#define R register ll#define ls (tr<<1)#define rs (tr<<1|1)const int M=100010;using namespace std;inline ll g() { R ret=0; register char ch; while(!isd

  • Party All the Time (三分裸题)2019-03-31 09:52:19

    In the Dark forest, there is a Fairy kingdom where all the spirits will go together and Celebrate the harvest every year. But there is one thing you may not know that they hate walking so much that they would prefer to stay at home if they need to walk a

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有