码迷,mamicode.com
首页 >  
搜索关键字:using password: yes    ( 53562个结果
Kruskal算法
#include <bits/stdc++.h> #define MAXN 200005 using namespace std; int node,edge,ans=0,k=0; int fat[MAXN],siz[MAXN]; struct EDGE { int from,to,cost; } ...
分类:编程语言   时间:2020-07-30 01:20:30    阅读次数:71
POJ 3468
线段树延迟标记的具体应用,是比较简单的区间加和修改 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <queue> using namespace std; const in ...
分类:其他好文   时间:2020-07-30 01:16:29    阅读次数:68
c# yield关键字的用法
1.yield实现的功能yield return:先看下面的代码,通过yield return实现了类似用foreach遍历数组的功能,说明yield return也是用来实现迭代器的功能的。 using static System.Console; using System.Collections ...
分类:Windows程序   时间:2020-07-30 01:11:00    阅读次数:106
HDU - 1166 敌兵布阵
题目链接 维护一个单点修改,区间查询的数据结构,树状数组和线段树均可以。 我写了树状数组。 #include<bits/stdc++.h> using namespace std; #define lowbit(x) (x & (-x)) char s[10]; int n; long long c ...
分类:其他好文   时间:2020-07-29 21:56:16    阅读次数:86
剑指offer-JZ48-不用加减乘除做加法(C++)
题目描述:写一个函数,求两个整数之和,要求在函数体内不得使用+、-、*、/四则运算符号。 心得:两数相加还能这么表示 1 #include <iostream> 2 3 using namespace std; 4 5 class Solution 6 { 7 public: 8 int Add(i ...
分类:编程语言   时间:2020-07-29 21:55:54    阅读次数:94
HDU - 1754 I Hate It
题目链接 线段树,单点修改,区间最大值查询。 #include<bits/stdc++.h> using namespace std; const int N = 2e5 + 10; int n,m; #define mid ((l + r) >> 1) #define ls (nod << 1) ...
分类:其他好文   时间:2020-07-29 21:53:09    阅读次数:77
POJ - 3468 A Simple Problem with Integers
题目链接 线段树区间修改,每个数均加上一个值。区间查询和。 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<string> #include<cmath> using namespa ...
分类:其他好文   时间:2020-07-29 21:42:43    阅读次数:65
UOJ#217. 【UNR #1】奇怪的线段树(广义线段树性质+上下界最小流)
http://uoj.ac/problem/217 题解: 考虑查询一个区间,遍历到的叶子一定是右儿子、右儿子、……、左儿子、左儿子。 反过来,值域连续的这样的若干节点也唯一对应一个区间。 所以右儿子给值域相邻的右、左儿子连边,左儿子只给左儿子连边,问题相当于最小路径覆盖(每个点可以被覆盖无限次,有 ...
分类:其他好文   时间:2020-07-29 21:36:48    阅读次数:66
背包解法2
分组背包: #include<iostream> #include<cmath> #include<cstring> #include<algorithm> using namespace std; int n,m; const int N=105; int f[N],v[N],w[N]; int ...
分类:其他好文   时间:2020-07-29 21:15:50    阅读次数:54
记票统计(HJ94)
输入输出格式一定要与样例一样,连一个空格,逗号都不能少,否者就会报错。 C++代码如下: #include <iostream> #include <vector> #include <string> #include <map> using namespace std; int main() { ...
分类:其他好文   时间:2020-07-29 17:46:11    阅读次数:95
53562条   上一页 1 ... 91 92 93 94 95 ... 5357 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!