- 博客(19)
- 收藏
- 关注
原创 yii2 储存控制过滤器ACF笔记
存取控制过滤器ACFuse yii\web\Controller;use yii\filters\AccessControl;class SiteController extends Controller{ public function behaviors() { return [ 'access' => [ ...
2018-03-21 21:01:46 235
原创 kruskal模版 [结构体存图]
kruskal的时间复杂度是O(eloge)。这里因为要给边排序,所以要用结构体存图。 然后用到了并查集检查两个点是否在同一连通分量里,以为在同一连通分量里的两个点如果链接一定形成了环,就不是树了。#include <iostream>#include <vector>#include <string>#include <cstring>#include <algorithm>#inc
2017-03-27 22:01:06 359
原创 POJ-3268 Silver Cow Party[Dijkstra] [邻接矩阵] [置换矩阵]
Time Limit: 2000MS Memory Limit: 65536KTotal Submissions: 21046 Accepted: 9625Description:One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big
2017-03-21 20:01:16 419
原创 POJ 2378. Til the Cows Come Home [dijkstra模版] [邻接矩阵]
Language:Til the Cows Come HomeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 49872 Accepted: 16910Description:Bessie is out in the field and wants to get back to the barn to
2017-03-21 19:46:12 182
原创 HUD_1745 I Hate It!【线段树】【最值查询修改】
Problem Description: 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input:本题目包含多组测试,请处理到文件结束。在每个测试的第一行,有两个正整数 N 和 M ( 0<N<=200000,0<
2017-03-14 20:46:32 217
原创 Jin Ge Jin Qu[01背包]
(If you smiled when you see the title, this problem is for you ^_^)For those who don‘t know KTV, see: http://en.wikipedia.org/wiki/Karaoke_boxThere is one very popular song called Jin Ge Jin Qu(劲歌金曲).
2017-03-10 19:59:05 269
原创 LightOJ - 1112 Curious Robin Hood [interval tree]
Robin Hood likes to loot rich people since he helps the poor people with this money. Instead of keeping all the money together he does another trick. He keeps n sacks where he keeps this mo
2017-03-03 21:06:54 337
原创 Catch That Cow POJ - 3278 [bfs][最短路]
Catch That Cow Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K
2017-01-25 18:22:47 332
原创 迭代器
迭代器的使用有点类似指针 引用它的值时要用到‘*’运算符下面是标准代码:#include <iostream>#include <vector>#include <cstdio>using namespace std;int main() { vector<int> ivec; ivec.push_back(1); ivec.push_back(2); ive
2016-12-28 09:16:10 186
转载 背包九讲里的01背包
P01: 01背包问题 题目 有N件物品和一个容量为V的背包。第i件物品的费用是c[i],价值是w[i]。求解将哪些物品装入背包可使价值总和最大。 基本思路 这是最基础的背包问题,特点是:每种物品仅有一件,可以选择放或不放。 用子问题定义状态:即f[i][v]表示前i件物品恰放入一个容量为v的背包可以获得的最大价值。则其状态转移方程便是: f[i][v]=max{f[i-1][v],f[
2016-12-08 13:47:11 181
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人