- 博客(35)
- 资源 (11)
- 收藏
- 关注
原创 BZOJ刷题集
1600: [Usaco2008 Oct]建造栅栏Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 1348 Solved: 841[Submit][Status][Discuss]Description勤奋的Farmer John想要建造一个四面的栅栏来关住牛们。他有一块长为n(4<=n<=2500)的木板,他想把这块本板切成4
2017-09-25 23:14:38 1753
原创 The Heaviest Non-decreasing Subsequence Problem 最长非递减子序列 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
题目链接根据题意,把值变换成数的个数,这样就变成了求最长非递减子序列,这里用O(n*log(n))的办法#include<bits/stdc++.h>using namespace std;typedef long long ll;const int N =200005;const int INF =1e9+5;ll a;ll v;ll t;vector<ll> num;//LIS
2017-09-25 15:00:20 415
原创 Frequent Subsets Problem 进制运算 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
题目链接因为n只到20,直接利用二进制的位运算暴力解决,1代表有该元素,0代表没有该元素#include<bits/stdc++.h>using namespace std;typedef long long ll;int n;double m;stringstream ss;string s;int t;int c[55];int sum=0;int main(){//
2017-09-25 10:58:58 317
原创 Train Seats Reservation 区间加减 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
题目链接由题意,直接进行区间加减 #include<bits/stdc++.h>using namespace std;typedef long long ll;struct node{ int l; int r; int k; bool operator<(const node x) { if(l==x.l)
2017-09-25 08:56:30 308
原创 A Cache Simulator 组成原理 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
题目链接会了组成原理,这就道水题详见https://wenku.baidu.com/view/6ad6e27f76c66137ee061990.html#include<bits/stdc++.h>using namespace std;typedef long long ll;ll a[(1<<6)+1];char s[100];int main(){// freopen("data
2017-09-24 21:52:49 795
原创 Finding the Radius for an Inserted Circle 公式/几何 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
题目链接几何加公式题,利用余弦定理求角的余弦值,进而求解#include<bits/stdc++.h>using namespace std;typedef long long ll;const long double pi = acos(-1.0);long double R;int k,l;long double ans[11];int main(){// freopen(
2017-09-24 21:44:30 351
原创 Minimum Distance in a Star Graph BFS/康托展开 2017 ACM-ICPC 亚洲区(南宁赛区)网络赛
题目链接模拟+BFS+康拓展开,此题的数据比较水,如果n为9就GG了#include<bits/stdc++.h>using namespace std;typedef long long ll;vector<int> mm[500005];int vis[500005];int n;ll sum =0;int a[11];int b[11];int fac[] = {1,1,2
2017-09-24 21:41:49 414
原创 742. [网络流24题] 深海机器人 费用流/连两条边
深海机器人问题 «问题描述: 深海资源考察探险队的潜艇将到达深海的海底进行科学考察。潜艇内有多个深海机器 人。潜艇到达深海海底后,深海机器人将离开潜艇向预定目标移动。深海机器人在移动中还 必须沿途采集海底生物标本。沿途生物标本由最先遇到它的深海机器人完成采集。每条预定 路径上的生物标本的价值是已知的,而且生物标本只能被采集一次。本题限定深海机器人只 能从其出发位置沿着向北或向东的方向移动
2017-09-21 11:36:58 262
原创 741. [网络流24题] 负载平衡 最小费用最大流/简单
★★☆ 输入文件:overload.in 输出文件:overload.out 简单对比 时间限制:1 s 内存限制:128 MB «问题描述: G 公司有n 个沿铁路运输线环形排列的仓库,每个仓库存储的货物数量不等。如何用最 少搬运量可以使n 个仓库的库存数量相同。搬运货物时,只能在相邻的仓库之间搬运。 «编程任务: 对于给定的n 个环形排列的仓库的库存量,编程计算使n
2017-09-21 09:20:20 290
原创 740. [网络流24题] 分配问题 费用流/求最大最小费用
«问题描述:有n件工作要分配给n个人做。第i 个人做第j 件工作产生的效益为c[i][j] 。试设计一个将 n件工作分配给n个人做的分配方案,使产生的总效益最大。 «编程任务:对于给定的n件工作和n个人,计算最优分配方案和最差分配方案。 «数据输入:由文件job.in提供输入数据。 文件的第1 行有1 个正整数n,表示有n件工作要分配给n 个人做。 接下来的n 行中,每行有n 个整数c[
2017-09-21 08:56:14 416
原创 739. [网络流24题] 运输问题 费用流/求最大最小值
[网络流24题] 运输问题 ★★☆ 输入文件:tran.in 输出文件:tran.out 简单对比 时间限制:1 s 内存限制:128 MB «问题描述:«编程任务: 对于给定的m 个仓库和n 个零售商店间运送货物的费用,计算最优运输方案和最差运 输方案。 «数据输入:«结果输出: 程序运行结束时,将计算出的最少运输费用和最多运输费用输出到文件tran.out中。
2017-09-21 08:48:01 1244
原创 732. [网络流24题] 试题库 费用流/最大最小值
问题描述:假设一个试题库中有n道试题。每道试题都标明了所属类别。同一道题可能有多个类别属性。现要从题库中抽取m 道题组成试卷。并要求试卷包含指定类型的试题。试设计一个满足要求的组卷算法。编程任务:对于给定的组卷要求,计算满足要求的组卷方案。数据输入:由文件testlib.in提供输入数据。文件第1行有2个正整数k和n (2 <=k<= 20, k<=n<= 1000)k 表示题库中试题类型总数,n
2017-09-21 08:24:56 318
原创 [网络流24题] 圆桌聚餐 最大流/路径输出
[网络流24题] 圆桌聚餐 ★★☆ 输入文件:roundtable.in 输出文件:roundtable.out 评测插件 时间限制:1 s 内存限制:128 MB «问题描述: 假设有来自m 个不同单位的代表参加一次国际会议。每个单位的代表数分别为 ri(i=1,2,3…m), 。会议餐厅共有n张餐桌,每张餐桌可容纳c i(i=1,2…n) 个代表就餐。 为了使代表们充
2017-09-21 00:59:13 360
原创 Maximum Flow 规律题 2017 ACM-ICPC 亚洲区(西安赛区)网络赛
Given a directed graph with nn nodes, labeled 0,1, \cdots, n-10,1,⋯,n−1.For each <i, j>i,j> satisfies 0 \le i 0≤ijn, there exists an edge from the i-th node to the j-th node, the capacity
2017-09-21 00:04:49 348
原创 B. Coin 数学/组合数 2017 ACM-ICPC 亚洲区(西安赛区)网络赛
Bob has a not even coin, every time he tosses the coin, the probability that the coin's front face up is \frac{q}{p}(\frac{q}{p} \le \frac{1}{2})pq(pq≤21).The question is, when Bob
2017-09-20 22:29:22 417
原创 C. Sum 数学/规律 2017 ACM-ICPC 亚洲区(西安赛区)网络赛
题目链接Define the function S(x)S(x) for xx is a positive integer. S(x)S(x) equals to the sum of all digit of the decimal expression of xx. Please find a positive integer kk that S(k*x)\%233=0S(k∗x)%233=0.
2017-09-20 22:25:46 297
转载 位运算应用
位运算是指按二进制进行的运算。在系统软件中,常常需要处理二进制位的问题。C语言提供了6个位操作运算符。这些运算符只能用于整型操作数,即只能用于带符号或无符号的char,short,int与long类型。 C语言提供的位运算符列表: 运算符 含义 描述 & 按位与 如果两个相应的二进制位都为1,则该位的结果值为1,否则为0 | 按位或 两个相应的二进制位中只要有一个为1,该位的结果值为1 ^
2017-09-20 22:01:58 299
原创 862C C. Mahmoud and Ehab and the xor XOR操作/构造
题目链接大神题解://解题思路:重点就是抓住异或的性质,两个相同的数异或等于0, //任何数异或0结果都不变。意思就是例如 3^4^5^3^4^5^6=6 。 //然后这道题就很简单了。假设我们要使最后的结果为X,大小为4, //那么我们可以 a^b^c^(a^b^c)^x=x,其中四个数分别为, //a,b,c,(a^b^c)。但是a^b^c可能等于a,b,c中的一个数, //所
2017-09-20 21:55:24 662
原创 HDU6208 The Dominator of Strings AC自动机 [2017 ACM/ICPC Asia Regional Qingdao Online]
题目链接Problem DescriptionHere you have a set of strings. A dominator is a string of the set dominating all strings else. The string S is dominated by T if S is a substring of T.InputThe input contains se
2017-09-20 12:21:00 328
原创 HDU6214 Smallest Minimum Cut 最小割/最少边 [2017 ACM/ICPC Asia Regional Qingdao Online]
题目链接Problem DescriptionConsider a network G=(V,E) with source s and sink t. An s-t cut is a partition of nodes set V into two parts such that s and t belong to different parts. The cut set is the subse
2017-09-20 12:12:50 331
原创 HDU 6216 A Cubic number and A Cubic Number 公式/打表 [2017 ACM/ICPC Asia Regional Qingdao Online]
Problem DescriptionA cubic number is the result of using a whole number in a multiplication three times. For example, 3×3×3=27 so 27 is a cubic number. The first few cubic numbers are 1,8,27,64 and 125
2017-09-20 11:39:57 313
原创 HDU6213 Chinese Zodiac STL水题 [2017 ACM/ICPC Asia Regional Qingdao Online]
HDU6213题目链接Problem DescriptionThe Chinese Zodiac, known as Sheng Xiao, is based on a twelve-year cycle, each year in the cycle related to an animal sign. These signs are the rat, ox, tiger, rabbit, dra
2017-09-20 11:33:00 403
原创 Brute Force Sorting 链表\模拟 [2017 ACM/ICPC Asia Regional Qingdao Online]
Brute Force Sorting题目链接Problem DescriptionBeerus needs to sort an array of N integers. Algorithms are not Beerus’s strength. Destruction is what he excels. He can destroy all unsorted numbers in the ar
2017-09-20 00:13:41 310
原创 C - Restore Graph CodeForces - 404C BFS+小trick
Valera had an undirected connected graph without self-loops and multiple edges consisting of nvertices. The graph had an interesting property: there were at most k edges adjacent to each of its vert
2017-09-15 00:06:19 316
原创 2017 ACM/ICPC Asia Regional Shenyang Online总结 5/11
B - cable cable cable HDU - 6195 Connecting the display screen and signal sources which produce different color signals by cables, then the display screen can show the color of the signal
2017-09-12 20:59:43 455
原创 字符串专题总结
A - Oulipo_KMP The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout
2017-09-11 18:45:19 454
原创 [网络流24题]魔术球问题(简化版) 最小路径覆盖+二分答案 + 很快的最大流
396. [网络流24题]魔术球问题(简化版★★☆ 输入文件:balla.in 输出文件:balla.out 简单对比时间限制:1 s 内存限制:128 MB问题描述: 假设有n根柱子,现要按下述规则在这n根柱子中依次放入编号为 1,2,3,4......的球。 (1)每次只能在某根柱子的最上面放球。 (2)在同一根柱子中,任何2个相邻球的编号之和为完全
2017-09-09 23:10:40 289
转载 二分图的最大匹配
二分图指的是这样一种图,其所有顶点可以分成两个集合X和Y,其中X或Y中任意两个在同一集合中的点都不相连,所有的边关联在两个顶点中,恰好一个属于集合X,另一个属于集合Y。给定一个二分图G,M为G边集的一个子集,如果M满足当中的任意两条边都不依附于同一个顶点,则称M是一个匹配。图中包含边数最多的匹配称为图的最大匹配。 二分图的最大匹配有两种求法,第一种是最大流;第二种就是我现在要讲的匈牙利
2017-09-09 22:31:24 383
原创 How to use epoll_event data.ptr
Do you know how to use the data.ptr in epoll_event? as you know typedef union epoll_data { void *ptr; int fd; __uint32_t u32; __uint64_t u64;}
2017-09-07 22:04:53 1029
原创 [简单dp]H - Happy Matt Friends HDU - 5119
H - Happy Matt Friends HDU - 5119Matt has N friends. They are playing a game together. Each of Matt’s friends has a magic number. In the game, Matt selects some (could be zero) of his
2017-09-06 21:59:21 417
原创 [思维]K - K.Bro Sorting HDU - 5122
K - K.Bro Sorting HDU - 5122 Matt’s friend K.Bro is an ACMer. Yesterday, K.Bro learnt an algorithm: Bubble sort. Bubble sort will compare each pair of adjacent items and swap t
2017-09-06 21:55:12 296
原创 区间dp总结
要点:状态必然包含区间是哪个[i,j],通过枚举区间分界点进行转移。也就是说一个大区间是由两个子区间合并来的或者是两个子区间加上中间元素合并来的! 在合并的时候自然是要满足最优化原理和无后效性原则......不能多说,到题目中去体会!这类问题经常会遇到环,环的处理办法通常有两种:謱)加倍——将数据复制加倍,就可以保证最后一个与第一个相连;謲)取余——在调用数组时对譮取余。
2017-09-06 21:51:06 310
原创 2017ACM/ICPC广西邀请赛
A Math ProblemTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 765 Accepted Submission(s): 318Problem DescriptionYou are given
2017-09-04 10:00:13 578
转载 矩阵快速幂专题【完结】
第一题 hdu 1757 A Simple Math Problem点击打开链接思路:矩阵快速幂分析:1 最简单的矩阵快速幂的题目,直接利用矩阵求解即可点击打开查看代码第二题 hdu 1575 Tr A点击打开hdu 1575思路: 矩阵快速幂分析:1 题目给定一个n*n的矩阵要求矩阵的
2017-09-03 22:14:02 365
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人