系列
nike0good
这个作者很懒,什么都没留下…
展开
-
三维几何专题
UVA 11275 3D TrianglesUVA 1469 ArdeniaUVA 1438 AsteroidsUVA 11275 3D Triangles#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;原创 2016-07-06 02:43:49 · 503 阅读 · 0 评论 -
几何专题
UVA 11178 Morley 定理LA 3263 That Nice Euler Circuit Shanghai 2004 欧拉定理UVA 11796 Dog DistanceUVA 12304 2D Geometry 110 in 1 内接圆和外接圆UVA 11178 Morley 定理#include<bits/stdc++.h>using namespace std;#def原创 2016-06-26 13:44:40 · 468 阅读 · 0 评论 -
DFS及其应用 专题
UVA 1364 Knights of the Round TableUVA 1108 Mining Your Own BusinessUVA 12167 Proving EquivalencesHDU 4635 Strongly connectedUVA 11324 The Largest CliqueUVA 1364 Knights of the Round Table无向图的双连通分量原创 2016-07-24 22:36:03 · 732 阅读 · 0 评论 -
网络流专题
Chips ChallengePerspectiveSightseeing tourOmbrophobic BovinesThe Maximum Number of Strong KingsSmart Network AdministratorIntergalactic MapFast Maximum FlowChips Challenge填坑Perspective一个小组若干球队,已原创 2016-08-07 10:50:16 · 476 阅读 · 0 评论 -
网络流专题2
BZOJ 1497 最大获利BZOJ 1565 植物大战僵尸HDU 5457 Hold Your HandBZOJ 1497 最大获利新的技术正冲击着手机通讯市场,对于各大运营商来说,这既是机遇,更是挑战。THU集团旗下的CS&T通讯公司在新一代通讯技术血战的前夜,需要做太多的准备工作,仅就站址选择一项,就需要完成前期市场研究、站址勘测、最优化等项目。在前期市场调查和站址勘测之后,公司得到了一共原创 2016-08-07 13:19:01 · 569 阅读 · 0 评论 -
西安十五日游 day12 练习 【AC 自动机】
Keywords Search病毒侵袭病毒侵袭持续中Word Puzzles考研路茫茫单词情结Resource ArchiverKeywords Search版子题#include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>#include<functional>#include<iostream>#原创 2016-08-14 10:44:53 · 358 阅读 · 0 评论 -
几何算法专题2
LA 2512 Art GalleryUVA 10084 Hotter ColderUVA 11726 Crime SceneUVA 12307 Smallest Enclosing RectangleLA 2512 Art Gallery#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n原创 2016-09-11 20:41:35 · 381 阅读 · 0 评论 -
西安十五日游day7 博弈专题
HDU 3863 No GamblingHDU 2176 取m堆石子游戏HDU 2177 取2堆石子游戏HDU 2486 A simple stone gameHDU 1404 Digital DeletionsHDU 1729 Stone GameHDU 1760 A New Tetris GameHDU 1907 JohnHDU 2234 无题IHDU 2368 Alfredo原创 2016-08-10 08:24:47 · 523 阅读 · 0 评论 -
西安十五日游day9 母函数计算
排列Blocks红色病毒问题分拆数 五边形定理PartitionInteger Partition组合Big Event in HDUIgnatius and the Princess IIISquare Coins排列现在有一长度为N的字符串,满足一下条件: (1) 字符串仅由A,B,C,D四个字母组成; (2) A出现偶数次(也可以不出现); (3) C出现偶数次(原创 2016-08-10 08:34:16 · 406 阅读 · 0 评论 -
线段树专题
HDU 1166 敌兵布阵HDU 1394 Minimum Inversion NumberHDU 1698 Just a HookPOJ 3468 A Simple Problem with IntegersPOJ 3225POJ 3667 HotelBZOJ 1067 降雨量HDU 1166 敌兵布阵单点加减区间求和#include<bits/stdc++.h>using nam原创 2016-09-03 18:33:14 · 413 阅读 · 0 评论 -
树状数组专题
BZOJ 1452 JSOI2009CountBZOJ 4240 有趣的家庭菜园BZOJ 3155 Preprefix sumBZOJ 2762 JLOI2011不等式组BZOJ 1537 POI2005Aut- The BusSPOJ DQUERYBZOJ 1452 [JSOI2009]Count 对每个权值建一颗BIT#include<bits/stdc++.h>using na原创 2016-09-03 21:07:45 · 594 阅读 · 0 评论 -
西安十五日游 day13 练习 【后缀自动机】
Lexicographical Substring SearchGlass Beadsstr2intAB StringNew Distinct SubstringsBoring countingLexicographical Substring Search给一个字符串,求第k大子串,经典题#include<cstdio>#include<cstring>#include<cstdli原创 2016-08-14 23:44:10 · 1055 阅读 · 0 评论 -
平面区域专题
LA 2797 Monster TrapLA 3218 Find the Border NEERC2004UVA 12296 Pieces and DiscsLA 3176 Art of War CERC2004LA 2797 Monster Trap如何判断一个平面区域是否有界? 想办法找出交点集合建图,考虑墙的厚度, 将每条边两边延长一点点,如果一个端点位于另一条线段内部,该点忽视#i原创 2016-09-05 13:31:13 · 480 阅读 · 0 评论 -
白书~区间信息维护习题
LA 2191 PotentiometersLA 5902 Movie CollectionLA 4108 SKYLINELA 4730 KingdomLA 2191 Potentiometers#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k原创 2016-09-19 20:58:16 · 335 阅读 · 0 评论 -
插头DP 专题
插头dp 整理先贴一份大牛的代码参考一下HDU 1693 Eat the Trees#include<stdio.h>#include<string.h>#include<iostream>#include<algorithm>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)const int HASH=10009;c原创 2016-12-10 23:57:23 · 503 阅读 · 0 评论 -
BZOJ 4747-4749题解 Usaco2016 Dec
BZOJ 4747: [Usaco2016 Dec]Counting Haybales给出N(1≤N≤100,000)个数,和 Q(1≤Q≤100,000)个询问。每个询问包含两个整数A,B(0≤A≤B≤1,000,00 0,000)。对于每个询问,给出数值在A到B间的数有多少个(包含A与B)。 暴力#include<bits/stdc++.h> using namespace std;原创 2017-03-03 17:11:40 · 1151 阅读 · 0 评论 -
MillerRabin与PollardRho
BZOJ 4802 欧拉函数Description已知N,求phi(N) Input正整数N。N<=10^18 Output输出phi(N) Sample Input8 Sample Output4直接套板子#include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>#include<functional>原创 2017-05-03 12:01:38 · 406 阅读 · 0 评论 -
数论专题
Always an integerAlways an integerc++,string类的花式使用#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define Rep(i,n) for(int原创 2016-06-12 21:37:41 · 508 阅读 · 0 评论 -
几何算法专题
UVA 10652 Board WrappingUVA 11168 AirportUVA 1396 Most Distant Point from the SeaUVA 1298 TriathlonUVA 1475 Jungle OutpostUVA 10652 Board Wrapping#include<bits/stdc++.h>using namespace std;#defin原创 2016-07-02 17:27:50 · 2603 阅读 · 0 评论 -
DLX专题
[toc] 一下题目可以套白书模板UVA 1309 Sudoku把Sudoku上的点拆成如下信息 (r,c)(r,c)是否填了 (r,v),(c,v),(s,v)(r,v),(c,v),(s,v)第r行/c列/s块是否填了v#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#d原创 2016-07-12 15:53:46 · 751 阅读 · 0 评论 -
# NOJ 2015年陕西省程序设计竞赛网络预赛(正式赛)(落后的小岛-最小生成树-并查集迭代路径优化与不优化对比)[Hobo]
G - 落后的小岛Time Limit: 3000 ms Memory Limit: 10240 KBSubmitDescription在某片海域分布着n座小岛,每个小岛的位置用一对整数(x, y)表示。但是小岛上的条件十分落后,人们只能划船到其他岛,这非常不方便。有一天,智慧与勇气并存的温温来到了这片海域,她决定帮助居民在小岛之间原创 2015-05-16 22:18:05 · 1198 阅读 · 0 评论 -
概率专题·期望
uva 11021 TribblesUVA 11722 Joining with FriendUVA 11427 Expect the ExpectedUVA 11762 Race to 1UVA 10491 So you want to be a 2n-aireUVA 11346 ProbabilityUVA 11637 Garbage Remembering ExamUVA原创 2016-01-02 00:40:11 · 655 阅读 · 0 评论 -
矩阵与线性方程组专题
UVA 10870 RecurrencesUVA 1386LA 3704 Cellular AutomatonUVA 10828 Back to Kernighan-RitchieUVA 11542 SquareUVA 10655 Contemplation AlgebraUVA 11149 Power of MatrixUVA 10808 Rational ResistorsUVA原创 2016-02-29 13:24:09 · 539 阅读 · 0 评论 -
数值方法专题
数值方法UVA 10341LA 5009 Error CurvesLA 3485 BridgeUVA 10668 Expanding RodsUVA 10385 Duathlon数值方法UVA 10341解方程:p∗e−x+rcos(x)+stan(x)+tx2+u=0,0≤x≤1p*e^{-x}+r \cos (x) + s \tan(x) +tx^2 + u =0,0 \le x \l原创 2016-03-01 07:54:48 · 581 阅读 · 0 评论 -
April Fools Day Contest 2016 题解
April Fools Day Contest 2016 题解原创 2016-04-02 17:13:48 · 1549 阅读 · 0 评论 -
ICPC Camp 2016 几道神奇的构造打表题
SJTU Dreadnought ContestThe Magic SquareThe Kirakira CycleXOR TreeMoscow SU Trinity ContestGreen DaySJTU Dreadnought ContestThe Magic Square题意:已知n≤100n\le 100, 你需要用n个边长为整数的正方形凑出一个大正方形,无解输出“Impossi原创 2016-02-22 00:28:30 · 1553 阅读 · 2 评论 -
置换专题
UVA 10294 Arif in Dhaka First Love Part 2UVA 12103 Leonardos NotebookUVA 11077 Find the PermutationsUVA 1156 Pixel ShuffleUVA 10601 CubesUVA 11330 Andys ShoesUVA 11774 Dooms DayUVA 11540 Sult原创 2016-02-12 22:51:06 · 825 阅读 · 0 评论 -
博弈专题·sg函数
UVA 12293 Box Game一个盒子n个球,另一个盒子有一个球,每次清空球较少的盒子,然后从较多的那个分一些球到空盒中,操作后2堆至少余1个球 甲乙轮流操作,无法操作者输,问赢家.计算sg函数,发现只有n=1,3,7,15,…2^n-1时,后手胜#include<cstdio>#include<cstring>#include<cstdlib>#include<algorithm>原创 2015-11-09 21:19:12 · 703 阅读 · 1 评论 -
GCJ Round 1A 2016
Problem A. The Last Word给S ≤ 1000字符,每次可以插队头、队尾,求字典序最小的结果 int T=read(); For(kcase,T) { string s; cin>>s; int n=SI(s); string ans; Rep(i,n) { if原创 2016-04-16 18:23:01 · 494 阅读 · 0 评论 -
GCJ Round 1B 2016
Getting the DigitsProblemYou just made a new friend at an international puzzle conference, and you asked for a way to keep in touch. You found the following note slipped under your hotel room door the原创 2016-05-01 13:09:16 · 587 阅读 · 0 评论 -
hihoCoder挑战赛20 题解
打折机票静态区间最大值SB题#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define Rep(i,n) for(int i=0;i<n;i++)#define ForD(i,n) for(i原创 2016-05-06 23:23:39 · 2505 阅读 · 0 评论 -
Codeforces Round #350 (Div. 2) 题解
HolidaysGame of RobotsCinemaMagic Powder - 12Correct Bracket Sequence EditorRestore a NumberHolidays#include<bits/stdc++.h>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define For原创 2016-05-07 00:25:35 · 3178 阅读 · 0 评论 -
基本计数方法专题
UVA 11401 Triangle CountingUVA 11806 CheerleadersLA 3516 Exploring PyramidsUVA 11361 Investigating Div-Sum PropertyLA 4123 Glenbow MuseumUVA 10253 Series-Parallel NetworksUVA 11038 How many 0sUV原创 2016-03-06 11:18:14 · 860 阅读 · 0 评论 -
最短路问题专题
UVA 11374 Airport Expressn点m边的无向图,额外给k条边,走这k条边需要票(你只有一张),求s->t最短路, n≤500,m≤1000,k≤1000n\le 500 ,m \le 1000,k \le 1000先求从源汇点出发的最短路,枚举k条边, ans=min(f1(a)+w(a,b)+f2(b))ans=min(f1(a)+w(a,b)+f2(b))UVA 1091原创 2016-04-01 18:56:47 · 774 阅读 · 0 评论 -
Bestcoder #80 题解 (待补)
Lucky对于一个数字集合S,定义关于S的幸运数字为无法用S中的数相加得到的最小的非负整数(每个数可以使用任意次). int T=read(); while (T--) { int n=read(); bool b=0,b2=0; For(i,n) { int p=read(); b|=(p原创 2016-04-17 17:14:20 · 506 阅读 · 0 评论 -
几何基础专题
UVA 11437 Triangle FunUVA 11800 Determine the Shape 四边形判定UVA 11646 Athletics TrackUVA 11817 Tunnelling the Earth 球面距离UVA 1473 Dome of CircusUVA 11524 InCircleUVA 11731 Ex-circles 旁切圆UVA 12300 Sm原创 2016-06-29 02:42:32 · 2148 阅读 · 0 评论 -
斜率优化专题
BZOJ 1597 Usaco2008 Mar土地购买BZOJ 1010 玩具装箱toyHDU 3507 Print ArticleHDU 2829 LawrenceBZOJ 1597: [Usaco2008 Mar]土地购买删掉没用的点,剩下的点排序 fi=min(fj+aj+1∗bi)f_i=min(f_j+a_{j+1}*b_i)#include<bits/stdc++.h>usin原创 2016-07-16 20:47:06 · 440 阅读 · 0 评论 -
# museum(Gauss-Jordan/Gauss对比-4倍常数)
【题一】博物馆(museum .cpp/c/pas) 厦门一中 刘定峰输入文件名:museum.in 输出文件名:museum.out源程序文件名:museum.c/cpp/pas时间限制:4s 内存限制:128MB [题目描述] 有一天Petya和他的朋友Vasya在进行他们众多旅行中的一次旅行,他们决定去参观一座城堡博物馆。这座博物馆有着特别的样原创 2013-05-04 19:36:35 · 1352 阅读 · 0 评论