ACMhdu题目分类很详细

合集下载

acm数学竞赛试题

acm数学竞赛试题

acm数学竞赛试题
ACM数学竞赛试题通常涉及各种数学领域,包括但不限于代数、几何、概率统计和组合数学等。

以下是一些经典的ACM数学竞赛试题:
1. 平面上n个点的k距离和最小值问题:给定平面上n个点,对于每个点,计算它到其他所有点的距离,然后求出这些距离中的k个最小值。

问题是:如何有效地计算这k个最小值?
2.最长公共子序列问题:给定两个序列,找出它们的最长公共子序列。

例如,对于序列
A = [1, 2, 3, 4] 和
B = [2, 3, 4, 5],最长公共子序列是[2, 3, 4]。

3. 凸包问题:给定平面上的一组点,找到一个最小的凸多边形,使得这个多边形能够包含这组点中的所有点。

4. 最短路问题:给定一个有向图,其中每条边都有一个非负的权重,找出图中任意两点之间的最短路径。

5. 子集和问题:给定一个正整数数组和一个目标值,判断数组中是否存在和为目标值的两个非空子集。

例如,给定数组[1, 2, 3, 4] 和目标值7,判断是否存在两个子集,它们的和分别为7。

以上只是ACM数学竞赛试题的一部分,实际上还有更多涉及数学各个领域的题目。

要提高解决这类问题的能力,需要不断练习和研究。

acm各大OJ题目分类

acm各大OJ题目分类

id page section no title18 1.2.1例题1盒子里的气球148359 3.1.2例题2管道问题149387 3.3.1例题1篱笆问题150388 3.3.1例题2合金制造问题151401 3.3.4例题1点集的直径29 1.2.1例题2图书馆313 1.2.2例题1钓鱼1438 1.3.1引例小球钟——时间与运动1540 1.3.1引例笑脸1644 1.3.2引例猜猜我想说什么1750 1.3.3引例勇士Ilya的故事1852 1.3.3例题1蚂蚁和瓢虫413 1.2.2例题2照亮的山景515 1.2.2例题3镜子盒2468 1.3.5例题1电缆2569 1.3.5引例黑白按钮2670 1.3.5例题2煎饼2772 1.3.5引例傻瓜Ivanushka的故事619 1.2.3例题1折纸痕720 1.2.3例题2三色多边形820 1.2.3例题3聪明的学生923 1.2.3例题4丢失的数1028 1.2.4例题1月亮之眼1129 1.2.4例题2Yanghee的数表1231 1.2.4例题3原子链1336 1.3.1引例铁轨1438 1.3.1引例小球钟——时间与运动1540 1.3.1引例笑脸1644 1.3.2引例猜猜我想说什么1750 1.3.3引例勇士Ilya的故事1852 1.3.3例题1蚂蚁和瓢虫1954 1.3.3例题2隔三遍历2061 1.3.4引例拯救大兵瑞恩的故事2162 1.3.4引例英雄和公主的故事2264 1.3.4引例电气工程师2367 1.3.5引例爱丽丝和精灵的故事2468 1.3.5例题1电缆2569 1.3.5引例黑白按钮2670 1.3.5例题2煎饼2772 1.3.5引例傻瓜Ivanushka的故事2875 1.3.5例题3士兵排队2976 1.3.5例题4最小可靠交换3080 1.4.1例题1代码等式3181 1.4.1例题2团伙3281 1.4.1例题3银河英雄传说3382 1.4.1例题4可爱的猴子3483 1.4.1例题5蜗牛3589 1.4.2例题1积水3689 1.4.2例题2赛车3790 1.4.2例题3可怜的奶牛3891 1.4.2例题4最轻巧的语言3997 1.4.3例题1马尔可夫链4099 1.4.3例题2促销41102 1.4.3例题3采矿42108 1.4.4例题1火星地图43110 1.4.4例题2最长回文子串44113 1.5.1例题1括号序列45116 1.5.1例题2棋盘分割46117 1.5.1例题3决斗47117 1.5.1例题4“舞蹈家”怀特先生48119 1.5.1例题5积木游戏49123 1.5.2例题1方块消除50123 1.5.2例题2公路巡逻51125 1.5.2例题3并行期望值52126 1.5.2例题4高性能计算机53130 1.5.2例题5模板匹配54131 1.5.2例题6不可分解的编码55133 1.5.2例题7青蛙的烦恼56134 1.5.2例题8排列问题57135 1.5.2例题9最优排序二叉树58138 1.5.2例题10Bugs公司59139 1.5.2例题11迷宫统计60142 1.5.2例题12贪吃的九头龙61150 1.5.3问题1最长公共子序列问题62150 1.5.3例题1排列的LCS问题63151 1.5.3问题2最长上升子序列问题64151 1.5.3问题3最优二分检索树65152 1.5.3问题4任务调度问题66155 1.5.3例题2序列分割67160 1.6.2引例加密网格68162 1.6.2引例最优程序69164 1.6.2引例旋转的玩具70169 1.6.3引例编辑书稿71171 1.6.3引例埃及分数72175 1.6.4引例三角形大战73178 1.6.4例题1L游戏74180 1.6.5例题1带宽75181 1.6.5例题2小木棍76181 1.6.5例题3生日蛋糕77183 1.6.5例题4汽车问题78184 1.6.5例题5Betsy的旅行79189 1.6.6例题1外公的难题80193 1.6.7例题1篮球冠军赛81204 2.1例题1 “麻烦”子82204 2.1例题2沙漠83205 2.1例题3浪人苏比84206 2.1例题4好动的佳佳85207 2.1例题5细菌86208 2.1例题6X行星87220 2.2.1例题1佳佳的困惑88220 2.2.1例题2除法表达式89221 2.2.1例题3数字游戏90221 2.2.1例题4fibonacci质数91222 2.2.1例题5神秘数92225 2.2.2例题1自动取款机93226 2.2.2例题2人类学家的烦恼94226 2.2.2例题3征服者的军营95233 2.2.3例题1仓库问题96233 2.2.3例题2二进制Stirling数97234 2.2.3例题3荒岛野人98240 2.3.2例题1单色三角形99243 2.3.2引例互不攻击的象100245 2.3.3例题1传球游戏101247 2.3.3例题2无聊的排序102252 2.3.3例题3多边形103257 2.3.4例题1装饰栅栏104258 2.3.4例题2Pibonacci数105259 2.3.4例题3巧克力106274 2.4.2例题1绣花107275 2.4.2例题2漆门108275 2.4.2例题3原始基因109276 2.4.2例题4超级翻转110281 2.4.3例题1地图的五着色111282 2.4.3例题2滑雪112283 2.4.3例题3水平可见线段的三角形113287 2.4.4例题1往返路114287 2.4.4例题2连通图编号问题115287 2.4.4例题3跳舞蝇116289 2.4.4例题4参观洞穴117291 2.4.4例题5公主和英雄118293 2.4.4例题6通讯员119295 2.4.4例题7幼儿园小朋友分组120299 2.5.1引例岛国121300 2.5.1引例野餐计划122303 2.5.1引例地震123304 2.5.2引例罗密欧与朱丽叶124306 2.5.2引例出纳员的雇佣125308 2.5.2例题1瘦陀陀与胖陀陀126309 2.5.2例题2新桥127310 2.5.2例题3穿越沙漠128311 2.5.2例题4隐型石头129312 2.5.2例题5双调路径130315 2.5.3引例奶牛的新年晚会131317 2.5.3引例航天计划问题132318 2.5.3引例终极情报网133323 2.5.3例题1圆桌吃饭问题134324 2.5.3例题2数字游戏135324 2.5.3例题3混合图的欧拉回路136325 2.5.3例题4家园137326 2.5.3例题5道路扩容138329 2.5.4引例神奇的魔术师139331 2.5.4引例任务安排140332 2.5.4引例棋盘上的骑士141333 2.5.4引例丘比特的烦恼142333 2.5.4引例魔术球问题143334 2.5.4例题1皇家卫士144336 2.5.4例题2固定分区的内存管理145336 2.5.4例题3玩具兵146338 2.5.4例题4千年盛典147353 3.1.2例题1房间最短路问题148359 3.1.2例题2管道问题149387 3.3.1例题1篱笆问题150388 3.3.1例题2合金制造问题151401 3.3.4例题1点集的直径152402 3.3.4例题2最小外接矩形153404 3.3.4例题3点集分割154410 3.4.1例题1锡刀154410 3.4.2例题2锡刀154410 3.4.3例题3锡刀154410 3.4.4例题4锡刀154410 3.4.5例题5锡刀154410 3.4.6例题6锡刀154410 3.4.7例题7锡刀154410 3.4.8例题8锡刀154410 3.4.9例题9锡刀154410 3.4.10例题10锡刀154410 3.4.11例题11锡刀154410 3.4.12例题12锡刀problem sourceACM/ICPC World Finals 2002. Problem A. Balloons in a BoxACM/ICPC Regional Contest Central Europe 1995. Problem D. Pipe(Classic)(Classic)(Classic)ACM/ICPC Regional Contest Northeast Europe 2001. Problem G. Library. Author: Elena Kryuchkova, Roman Elizarov ACM/ICPC Regional Contest East Central North America 1999. Problem G. Gone FishingACM/ICPC World Finals 1995. Problem B. Tempus et mobilius Time and MotionInternet Problem Solving Contest 2001. Problem F. A Censored SmileIOI2002 Practice Session Problem 2. String from substringsUSU high school programming contest 2001. Problem G.Ilya Murumetz. Author: Katz O.E.Polish Olympiad in Informatics 2001. Stage II Problem 4. Ants and the ladybugCentral European Olympiad in Informatics 2000. Day 2 Problem 3. Enlightened LandscapeBaltic Olympiad in Informatics 2001. Day 1 Problem 3. MirrorACM/ICPC Regional Contest Northeast Europe 2001. Problem C. Cable Master. Author: Vladimir Pinaev, Roman Elizaro Internet Problem Solving Contest 2000. Problem F. PuzzleUniversity of Duke Programming Contest 1993. Problem C. Stacks of FlapjacksUSU high school programming contest 2001. Problem A. Gaby Ivanushka. Author: Shamgunov N.ACM/ICPC Regional Contest South Pacific 1992. Problem F. Paper FoldingThird USU personal programming contest, Ekaterinburg, Russia, February 16, 2002. Author:Dmitry Filimonenkov CTSC 2001. Day 1 Problem 3. Clever. Author: Li Zhang(Classic)Balkan Olympiad in Informatics 1998. Day 2 Problem 2. Evil EyesACM/ICPC Regional Contest Asia-Taejon 2000. Problem H. Lost ListsCentral European Olympiad in Informatics 2001. Day 1 Problem 1. ChainACM/ICPC Regional Contest Central European 1997. Problem A. RailsACM/ICPC World Finals 1995. Problem B. Tempus et mobilius Time and MotionInternet Problem Solving Contest 2001. Problem F. A Censored SmileIOI2002 Practice Session Problem 2. String from substringsUSU high school programming contest 2001. Problem G.Ilya Murumetz. Author: Katz O.E.Polish Olympiad in Informatics 2001. Stage II Problem 4. Ants and the ladybugPolish Olympiad in Informatics 1995. Stage III Problem 2. Step Traversing a TreeCTSC 1999. Day 2 Problem 3. RescueACM/ICPC Regional Contest Asia-Shanghai 1999. Problem I. Princess and HeroCentral European Olympiad in Informatics 1996. Day 2 Problem 3. ElectricianInternet Problem Solving Contest 2000. Problem C. TrollsACM/ICPC Regional Contest Northeast Europe 2001. Problem C. Cable Master. Author: Vladimir Pinaev, Roman Elizaro Internet Problem Solving Contest 2000. Problem F. PuzzleUniversity of Duke Programming Contest 1993. Problem C. Stacks of FlapjacksUSU high school programming contest 2001. Problem A. Gaby Ivanushka. Author: Shamgunov N.Central European Olympiad in Informatics 1998. Day 2 Problem 1. SolidersACM/ICPC Regional Contest Central European 2001. Problem E. ExchangesPolish Olympiad in Informatics 1998. Stage II Problem 2. Word EquationsBaltic Olympiad in Informatics 2003. Day 2 Problem 1. The GangsNOI2002 Day 1 Problem 1. Galaxy. Author: Ji LuoPolish Olympiad in Informatics 2003. Stage III Problem 1. Monkey(Classic)Polish Olympiad in Informatics 1999. Stage III Problem 6. WaterCentral European Olympiad in Informatics 2003. Day 1 Problem 3. The RaceOIBH Reminiscene Programming Contest. Problem E. Eat or Not to Eat. Author: Rujia LiuPolish Olympiad in Informatics 1998. Stage III Problem 4. The lightest languageCTSC 2001. Day 2 Problem 2. Markov. Author: Runting ShiPolish Olympiad in Informatics 2000. Stage III Problem 6. PromotionPolish Olympiad in Informatics 2001. Stage III Problem 5. GoldmineBaltic Olympiad in Informatics 2001. Day 2 Problem 2. Mars MapsACM/ICPC Regional Contest Asia-Kanpur 2001. Problem E. Viewer's Prize in F-TVACM/ICPC Regional Contest Northeast Europe 2001. Problem B. Bracket Sequence. Author: Andrew StankevichNOI99 Day 2 Problem 1. ChessPolish Olympiad in Informatics 1999. Stage I Problem 1. MusketeersACM/ICPC Regional Contest Asia-Shanghai 2000. Problem C. Dance Dance RevolutionNOI97 Day 2 Problem 2. GameIOI2003 National Training Team Originals. Author: Cailiang Liu. ModifiedCTSC2000. Day 1 Problem 3. Patrol. Author: Shenjie LiACM/ICPC Regional Contest Asia-Tehran 2001. Problem G. Parallel ExpectationIOI2001 National Training Team Winter Camp. Problem 2. HPC. Author: Xin QiCentral European Olympiad in Informatics 2001. Day 2 Problem 2. PatternsACM/ICPC World Finals 2002. Problem B. Undecodable Codes(Classic)(Classic)CTSC2001. Day 2 Problem 2. Tree. Author: Fan YangCentral European Olympiad in Informatics 2002. Day 1 Problem 1. BugsElite Problemsetters' First Contest. Problem A. Maze Statistics. Author: Derek KismanNOI2002 Day 1 Problem 3. Dragon. Modification of Internet Problem Solving Contest 2001. B. Author: Ziqing Mao (Classic)(Classic)(Classic)(Classic)IOI2002 Day 2 Problem 1. BatchBalkan Olympiad in Informatics 2003. Day 2 Problem 2. Euro. ModifiedCentral European Olympiad in Informatics 1996. Day 1 Problem 1. Encoding GridACM/ICPC Regional Contest Southwestern Europe 1996. Problem A. Optimal ProgramsACM/ICPC Regional Contest Southwestern Europe 1999. Problem E. Color HashACM/ICPC Regional Contest Asia-Kanpur 2001. Problem G. Editing a Book(Classic)ACM/ICPC Regional Contest East Central North America 1999. Problem A. Traingle WarBaltic Olympiad in Informatics 2002. Day 2 Problem 2. L game. Author: Jimmy MårdellNew Zealand Programming Contest 1991. Problem A. BandwidthACM/ICPC Regional Contest Central Europe 1995. Problem H. SticksNOI99 Day 1 Problem 3. CakeIOI94 Day 2 Problem 1. CarUSACO Computing Olympiad4th Shuguang Programming Contest. Author: Rujia LiuBaltic Olympiad in Informatics 1999. Day 1 Problem 3. BasketballUral Collegiate Programming Contest, April 2001, Perm English TourRomanian Open Contest, December 2001. Author: Mugurel Ionut AndreicaIOI99 National Training Team Originals. Author: Fangfang XiaIV Ural State University Collegiate Programming Contest. Problem G. Nikifor's Walk. Author: Dmitry Filimonenkov Internet Problem Solving Contest 2003. Problem H. Hordes of BacteriaCentral European Olympiad in Informatics 2000. Day 1 Problem 1. X-PlanetUSU Open Collegiate Programming Contest March'2001 Senior Session. Problem F. Nikifor. Author: Filimonenkov D. Baltic Olympiad in Informatics 2000. Day 2 Problem 1. DIVRandy Game. Problem D. Number Game. Author: Chong LongACM/ICPC World Finals Warm-up Contest(Oriental) 2002, Problem A. The Fibonacci Primes. Author: Shahriar Manzoor ACM/ICPC Regional Contest Southeastern European 2001. Problem C. Secret NumbersPolish Olympiad in Informatics 1998. Stage III Problem 2. ATM'sACM/ICPC Regional Contest Southwestern Europe 1999. Problem B. The Archeologists' DilemmaCentral European Olympiad in Informatics 2002. Day 1 Problem 2. ConquerTetrahedron Team Contest May 2001. Problem H. Warehouse Problem. Author: D. FilimonenkovACM/ICPC Regional Contest Central Europe 2001. Problem B. Binary Stirling Numbers.NOI2002. Day 2 Problem 1. Savages. Author: Rujia LiuPolish Olympiad in Informatics 1997. Stage III Problem 5. Monochromatic TrianglesACM/ICPC World Finals Warm-up Contest(Oriental) 2002, Problem B. Bishops. Author: Rezaul Alam ChowdhuryIOI2000 National Training Team Originals. Author: Yi GuoACM/ICPC World Finals 2002. Problem H. Silly Sort(Classic)Central European Olympiad in Informatics 2002. Day 1 Problem 3. FenceInternet Problem Solving Contest 2001. Problem G. FibonacciACM/ICPC Regional Contest Beijing 2002. Problem F. ChocolateUral Collegiate Programming Contest '99. Problem H. Cross-Stitch. Author: Zaletsky PIV Ural State University Collegiate Programming Contest. Problem F. Door Painting. Author: Magaz AsanovPolish Olympiad in Informatics 1999. Stage III Problem 5. PrimitivusIOI2003 National Training Team Originals. Author: Zhilei Xu.(Classic)Polish Olympiad in Informatics 2000. Stage I Problem 3. SkiersACM/ICPC Regional Contest Central Europe 2001. Problem H. Horizontally Visible SegmentsCentral European Olympiad in Informatics 2001. Day 1 Problem 3. Round Trip(Classic)Polish Olympiad in Informatics 2001. Stage III Problem 1. Wandering flees TrainersCentral European Olympiad in Informatics 1997. Day 1 Problem 1. CAVACM/ICPC Regional Contest Central Europe 2001. Problem A. Alice and BobPolish Olympiad in Informatics 1996. Stage I Problem 3. MessengersIV Ural State University Collegiate Programming Contest. Problem E. Partition into Groups. Author: Dmitry Filimonenko ACM/ICPC World Finals 2002. Problem E. IslandACM/ICPC Regional Contest East Central North America 2000. Problem A. PicnicUSACO Computing Olympiad US Open 2001. Problem 2. EarthquakeInternet Problem Solving Contest 1999. Problem H. Romeo and JulietACM/ICPC Regional Contest Asia-Tehran 2000. Problem G. Cashier EmploymentACM/ICPC World Finals Warm-up Contest(Occidental) 2002. Problem A. Asterix and Obelix. Author: Rezaul Alam Cho Balkan Olympiad in Informatics 2000. Day 2 Problem 1. BridgeACM/ICPC World Finals 2002. Problem C. Crossing the DesertACM/ICPC Regional Warm-up Contest 2002. Problem D. The Rock. Author: Jimmy MårdellBaltic Olympiad in Informatics 2002. Day 2 Problem 1. Bicriterial routingUSA Computing Olympiad Winter 2002. Problem 2. New Years Party. Author: Hal Burch(Classic)CTSC2001. Day 1 Problem 1. Agent. Authro: Li ZhangACM/ICPC World Finals Warm-up Contest(Occidental) 2002. Problem D. The Grand Dinner. Author: Rezaul Alam Chow UVA Monthly Contest. Problem H. The Eagles' Nest. Author: Monirul HasanACM/ICPC Regional Contest Northwestern Europe 2002. Problem G. Sightseeing tour. Author: Jimmy MårdellCTSC1999. Day 1 Problem 3. HomelandIOI2000 National Training Team Originals. Author: Li ZhangInternet Problem Solving Contest 2001. Problem H. MagicACM/ICPC Regional Contest Asia-Beijing 2002. Problem G. Machine ScheduleBaltic Olympiad in Informatics 2001. Day 2 Problem 1. KnightCTSC2000. Day 2 Problem 1. Cupid. Author: Fan YangOIBH Reminiscene Programming Contest. Problem H. Hanoi Tower Troubls Again! Author: Rujia LiuCentral European Olympiad in Informatics 2002. Day 2 Problem 2. GuardACM/ICPC World Finals 2001. Problem G. Fixed Partition Memory ManagementCTSC2002. Day 1 Problem 3. Toy. Author: Rujia LiuCTSC2003. Day 1 Problem 3. Ceremony. Author: Rujia LiuACM/ICPC Regional Contest Mid-Central North America 1996. Problem B. The doorACM/ICPC Regional Contest Central Europe 1995. Problem D. Pipe(Classic)(Classic)(Classic)ACM/ICPC Regioanl Warmup 2001. Problem F. Smallest Bounding Rectangle. Author: Rezaul Alam ChowdhuryACM/ICPC World Finals Warm-up Contest(Occidental) 2002. Problem K. The Great Divide. Author: Rezaul Alam Chow ACM/ICPC Regional Contest Central Europe 1996. Problem A. Tin CutterACM/ICPC Regional Contest Central Europe 1997. Problem A. Tin CutterACM/ICPC Regional Contest Central Europe 1998. Problem A. Tin CutterACM/ICPC Regional Contest Central Europe 1999. Problem A. Tin CutterACM/ICPC Regional Contest Central Europe 2000. Problem A. Tin CutterACM/ICPC Regional Contest Central Europe 2001. Problem A. Tin CutterACM/ICPC Regional Contest Central Europe 2002. Problem A. Tin CutterACM/ICPC Regional Contest Central Europe 2003. Problem A. Tin CutterACM/ICPC Regional Contest Central Europe 2004. Problem A. Tin CutterACM/ICPC Regional Contest Central Europe 2005. Problem A. Tin CutterACM/ICPC Regional Contest Central Europe 2006. Problem A. Tin CutterACM/ICPC Regional Contest Central Europe 2007. Problem A. Tin Cutterdata submit how2submit n ny y uva303n nn nn ny y ural1188 y y uva757n y uva239y ny nn y ural1088 y nn ny ny y ural1184 y ny y uva120n y ural1082 y y uva177n y ural1181 y nn ny nn ny ny y uva514n y uva239y ny nn y ural1088 y ny ny nn y uva258n ny ny y ural1184 y ny y uva120n y ural1082 y ny y zju1388y ny ny ny nn ny ny ny y uva10273 y nn ny ny ny nn ny y ural1183y ny nn ny ny y uva10559y ny y zju1022y ny nn nn y ural1143n ny ny ny y uva10531y nn nn nn y uva10534(slightly modified) n y uva10304y ny nn ny y uva656n y uva704n ny ny y uva751y ny y uva140y y uva307y ny ny ny ny nn y ural1155n y ural1170y nn y ural1130y ny nn y ural1095y ny y uva10164n y uva10236y yy nn y uva701y nn y ural1107 n y zju1385 y y uva10413 y nn y uva10237 y nn nn ny ny ny y zju1363 n y ural1035 n y ural1129 y nn nn ny ny y zju1391 y nn ny ny ny y zju1384 y nn y ural1128 n ny yy ny ny y zju1420 n y uva10246 y nn nn y uva10381 y ny nn ny nn y uva10249 y y uva10546 y y zju1992 y ny ny ny y zju1364 y ny ny y uva10276 y nn ny y uva10418y ny y uva393 y y uva303 n nn nn nn y uva10173 n y uva10256 y y uva308 y y uva309 y y uva310 y y uva311 y y uva312 y y uva313 y y uva314 y y uva315 y y uva316 y y uva317 y y uva318 y y uva319。

杭电ACM试题详细分类,杭电oj详细分类,hdu详细分类,详细,ACM

杭电ACM试题详细分类,杭电oj详细分类,hdu详细分类,详细,ACM
数论
1164 1211 1215 1222 1286 1299
计算几何
1086 1115 1147
贪心
1009 1052 1055 1232 1272
线段树,离散化
1199 1255
图论 最短路相关的问题
1142 1162 1217 1301
二分图问题
1054 1068 1150 1151 1281
杭电ACM试题分类 枚举
1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 1049 1050 1057 1062 1063 1064 1070 1073 1075 1082 1083 1084 1088 1106 1107 1113 1117 1119 1128 1129 1144 1148 1157 1161 1170 1172 1177 1197 1200 1201 1202 1205 1209 1212(大数取模) 1216(链表)1218 1219 1225 1228 1229 1230 1234 1235 1236 1237 1239 1250 1256 1259 1262 1263 1265 1266 1276 1279 1282 1283 1287 1296 1302 1303 1304 1305 1306 1309 1311 1314
2549、2550、2551、2552、2555、2560、2561、2562、2566、2567、 2568、2700、2710、
DP:1003、10240、1029、1069、1074、1087、1114、1159、1160、
1171、1176、1203、1231、1257、1260、1284、1421、1789、1978、 2059、2084、2159、2191、2544、2571、2602、2709、

图论类型各题总结-acm

图论类型各题总结-acm

hdu4318 Power transmission 最短路当数据很大的时候的解决办法一道题目的解题全过程记录最短路解决大数据模拟链表Power transmissionTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 663 Accepted Submission(s): 231Problem DescriptionThe project West-East power transmission is famous around the world. It transmits the electricity from western areas to east China. There are many nodes in the power system. Each node is connected with several other nodes in the system by cable. Power can be only transmitted between two connected nodes. For each node, it can’t send power to two or more other nodes at the same time.As we have all known, power will be loss during the transmission. Bob is the chief engineer of the project. He wants to build a transmission line which send power from one node to another node and minimize the power loss at the same time. Now he asks you to help him solve the problem.InputThere are several test cases. For each test case, the first line contains an integer N (0 < N ≤ 50000) which represents the number of nodes in the power system. Then there will be N groups of data following. For the i-th(0 < i ≤ N) group, the first line is an integer ki (ki ≤ 50), which means the node i is connected with ki nodes. The rest of the i-th group data are divided into ki lines. Each line contains an integer ai (0 < ai ≤ N, ai ≠ i) and an integer bi (0 ≤ bi ≤ 100), which represents power can be transmitted from node i to ai and will loss bi% while transmitting. The last line of input data contains three integers separated by single spaces. The first one is s, the second is t (0 < s, t ≤ N), and the third is the total power M (0 < M ≤ 10^6) at node s.OutputFor each test case, output the minimum of loss power while transmitting from node s to node t. The result should be printed with two digits to the right of the decimal point. If power cannot be transmitted from node s to node t, output “IMPOSSIBLE!” in a line.Sample Input422 503 7021 304 2021 104 401 4 100Sample Output60.00HintIn the sample, the best transmission line is 1 -> 2 -> 4, loss power is 100 * 50% + 100 * (100%-50%)*20% = 60.00MicrosoftInternetExplorer402DocumentNotSpecified7.8Normal0题意:多个点从一个点往另一个点运输天然气但是从某点到另外一点是会有损耗的题中输入的即为损耗的百分数问从点s到t最少损耗多少分析: 很明显是最短路问题但是有个比较卡人的地方就是最多会有50000个点数据太大用map数组存不下会爆掉我们考虑到用链表就用了数组去模拟链表保存从当前点能到达的点队长把写解题报告的任务光荣的交给了我但是我对看代码表示相当的纠结所以就自己去写了个好理解把自己的贴上/*#include<stdio.h>#include<string.h>struct haha{int son[55]; //记录从当前点到其它能走到的点double son_val[55]; //记录从当前点到其它能走到的点的消耗intt;//记录存取的儿子个数}a[50100];int n,flag,s,t,M,used[50100];double min[50100];double find_short()//模拟以前数据比较小的时候的模板{int i,j,pos,cnt;double mm;memset(used,0,sizeof(used));for(i=1;i<=n;i++) min[i]=1;t=a[s].cnt;while(cnt--){min[a[s].son[cnt]]=a[s].son_val[cnt];}used[s]=1;min[s]=0;for(i=2;i<=n;i++){mm=1;for(j=1;j<=n;j++){if(!used[j]&&mm>min[j]){pos=j;mm=min[j];}}if(mm==1) {flag=1;return 0;}used[pos]=1;t=a[pos].cnt;for(j=0;j<cnt;j++){if(!used[a[pos].son[j]]&&min[pos]+(1.0-min[pos])*a[pos].son_val[j]<min[a[pos].s on[j]])min[a[pos].son[j]]=min[pos]+(1.0-min[pos])*a[pos].son_val[j];}if(pos==t) return min[t];//这里很重要不加会超时的哦}return min[t];}int main(){int i,m,x,y;double val,k;while(scanf("%d",&n)!=EOF){flag=0;for(i=1;i<=n;i++)a[i].cnt=0;for(i=1;i<=n;i++){scanf("%d",&m);while(m--){scanf("%d %d",&x,&y);val=y/100.0;a[i].son[a[i].cnt]=x;a[i].son_val[a[i].cnt++]=val;}}scanf("%d %d %d",&s,&t,&M);k=find_short();if(flag==1) {printf("IMPOSSIBLE!\n");continue;}printf("%.2lf\n",k*M);}return 0;}*/hdu1596 find the safest road 最短路也能求最大值分类:图论 2012-07-27 23:21177人阅读评论(0)收藏编辑删除find the safest roadTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2477 Accepted Submission(s): 978Problem DescriptionXX 星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2,ek是P 上的边,现在8600 想出去旅游,面对这这么多的路,他想找一条最安全的路。

HDU100题简要题解(2060~2069)

HDU100题简要题解(2060~2069)

HDU100题简要题解(2060~2069)这⼗题感觉是100题内相对较为⿇烦的,好多数学题,有点搞我⼼态...歪⽐巴⼘HDU2060 SnookerProblem Descriptionbackground:Philip likes to play the QQ game of Snooker when he wants a relax, though he was just a little vegetable-bird. Maybe you hadn't played that game yet, no matter, I'll introduce the rule for you first.There are 21 object balls on board, including 15 red balls and 6 color balls: yellow, green, brown, blue, pink, black.The player should use a white main ball to make the object balls roll into the hole, the sum of the ball's fixed value he made in the hole is the player's score. The player should firstly made a red ball into the hole, after that he gains red-ball's value(1 points), then he gets the chance to make a color ball, then alternately. The color ball should be took out until all the red-ball are in the hole. In other word, if there are only color balls left on board, the player should hit the object balls in this order: yellow(2 point), green(3 point), brown(4 point), blue(5 point), pink(6 point), black(7 point), after the ball being hit into the hole, they are not get out of the hole, after no ball left on board, the game ends, the player who hasthe higher score wins the game. PS: red object balls never get out of the hole.I just illustrate the rules that maybe used, if you want to contact more details, visit afterthe contest.for example, if there are 12 red balls on board(if there are still red ball left on board, it can be sure that all the colorballs must be on board either). So suppose Philp can continuesly hit the ball into the hole, he can get the maximun score is12 * 1 (12 red-ball in one shoot) + 7 * 12(after hit a red ball, a black ball which was the most valuable ball should be the target) +2 +3 +4 +5 +6 + 7(when no red ball left, make all the color ball in hole).Now, your task is to judge whether Philip should make the decision to give up when telling you the condition on board(How many object balls still left not in the hole and the other player's score). If Philp still gets the chance to win, just print "Yes", otherwise print "No". (PS: if the max score he could get on board add his current score is equal to the opponent's current score, still output "Yes")InputThe first line contains a numble N indicating the total conditions. Then followed by N lines, each line is made of three integers: Ball_Left P_Score O_Score represeting the ball number left on board, Philp's current score, and the opponent's current score.All the input value are in 32 bit integer value range.OutputYou should caculate the max score left Philp can gain, and judge whether he has the possiblity to win.Sample Input212 1 11 30 39Sample OutputYesNo看到题⽬,脸上笑嘻嘻,⼼⾥......硬着头⽪看完了,发现是道⽔题:)分两种情况,加起来:1、⼤于六个球也就是有红球的情况,每打⼀个红球就紧接着打⼀个⿊球,打完红球再把其他颜⾊的打进去2、少于六个球也就是⽆红球的情况,假装剩下的都是相对较⼤的球#include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>using namespace std;int n, x, num1, num2;int main() {while (scanf("%d", &n) != EOF) {while (n--) {scanf("%d%d%d", &x, &num1, &num2);if (x > 6)num1 += (x - 6) * 8 + 27;else {int cnt = 7;while (x--) {num1 += cnt;cnt--;}}if (num1 >= num2) printf("Yes\n");else printf("No\n");}}return 0;}HDU2061 Treasure the new start, freshmen!Problem Descriptionbackground:A new semester comes , and the HDU also meets its 50th birthday. No matter what's your major, the only thing I want to tell youis:"Treasure the college life and seize the time." Most people thought that the college life should be colorful, less presure.But in actual, the college life is also busy and rough. If you want to master the knowledge learned from the book, a great deal of leisure time should be spend on individual study and practise, especially on the latter one. I think the every one of you should take the learning attitude just as you have in senior school."No pain, No Gain", HDU also has scholarship, who can win it? That's mainly rely on the GPA(grade-point average) of the student had got. Now, I gonna tell you the rule, and your task is to program to caculate the GPA.If there are K(K > 0) courses, the i-th course has the credit Ci, your score Si, then the result GPA isGPA = (C1 * S1 + C2 * S2 +……+Ci * Si……) / (C1 + C2 + ……+ Ci……) (1 <= i <= K, Ci != 0)If there is a 0 <= Si < 60, The GPA is always not existed.InputThe first number N indicate that there are N test cases(N <= 50). In each case, there is a number K (the total courses number), then K lines followed, each line would obey the format: Course-Name (Length <= 30) , Credits(<= 10), Score(<= 100).Notice: There is no blank in the Course Name. All the Inputs are legalOutputOutput the GPA of each case as discribed above, if the GPA is not existed, ouput:"Sorry!", else just output the GPA value which is rounded to the 2 digits after the decimal point. There is a blank line between two test cases.Sample Input23Algorithm 3 97DataStruct 3 90softwareProject 4 852Database 4 59English 4 81Sample Output90.10Sorry!头⼤,看完发现⼜是⼀道⽔题,题意的精华在于其中的公式:GPA = (C1 * S1 + C2 * S2 +……+Ci * Si……) / (C1 + C2 + ……+ Ci……) (1 <= i <= K, Ci != 0)然后⽤这个算,并且⽤⼀个flag记录是否存在有不及格科⽬的情况#include <iostream>#include <cstdio>#include <cmath>#include <cstring>#include <algorithm>using namespace std;int n, m;double a[101], b[101];int main() {while (scanf("%d", &n) != EOF) {while (n--) {scanf("%d", &m);double sum = 0;double num = 0;int flag = 0;for (int i = 1; i <= m; i++) {string s;cin >> s;scanf("%lf%lf", &a[i], &b[i]);if (b[i] < 60) flag = 1;sum += a[i] * b[i];num += a[i];}if (flag == 1) cout << "Sorry!" << endl;else {double ans = (sum + 0.0) / num;printf("%.2lf\n", ans);}if (n) cout << endl;}}return 0;}HDU2062 Subset sequenceProblem DescriptionConsider the aggregate An= { 1, 2, …, n }. For example, A1={1}, A3={1,2,3}. A subset sequence is defined as a array of a non-empty subset. Sort all the subset sequece of An in lexicography order. Your task is to find the m-th one.InputThe input contains several test cases. Each test case consists of two numbers n and m ( 0< n<= 20, 0< m<= the total number of the subset sequence of An ).OutputFor each test case, you should output the m-th subset sequence of An in one line.Sample Input1 12 12 22 32 43 10Sample Output111 222 12 3 1⼈傻了,康了题解才解决这题,卡这题上了⼀上午...这题我感觉算是这100题⾥思维含量最⾼的⼏个了,反正我是傻了(因为菜借这题终于明⽩了三元运算符,⾼中的时候看学弟⽤过,⼀脸懵逼也没想着去学,终于知道是个啥东西了(求gcd的时候还挺⽅便的,直接⼀⾏解决)题⽬⼤意:考虑⼀个集合 An = { 1, 2, ..., n}。

HDUOJ训练题

HDUOJ训练题

OJ输入输出训练:HDOJ 1089 ~HDOJ 1096一、C语言基础练习1001 计算两点间的距离HDOJ 2001 1002 第几天?HDOJ 2005 1003 平方和与立方和HDOJ 2007 1004 水仙花数HDOJ 2010 1005 素数判定HDOJ 2012 1006 数列有序!HDOJ 2019 1007 发工资咯:)HDOJ 2021 1008 海选女主角HDOJ 2022 1009 求平均成绩HDOJ 2023 1010 汉字统计HDOJ 2030 1011 进制转换HDOJ 2031 1012 杨辉三角HDOJ 2032 1013 人见人爱A+B HDOJ 2033 1014 人见人爱A-B HDOJ 2034 1015 亲和数HDOJ 2040 1016 Sum Problem HDOJ 1001 1017 A + B Problem II HDOJ 1002 1018 Let the Balloon Rise HDOJ 1004 1019 Elevator HDOJ 1008 1020 FatMouse' Trade HDOJ 1009 1021 As Easy As A+B HDOJ 1040 1022 The Hardest Problem Ever HDOJ 1048 1023 Climbing Worm HDOJ 1049 1024 Text Reverse HDOJ 1062 1025 An Easy Task HDOJ 1076 1026 What Is Your Grade? HDOJ 1084二、简单数学题1001 最小公倍数HDOJ 1108 1002 Least Common Multiple HDOJ 1019 1003 人见人爱A^B HDOJ 0235 1004 Rightmost Digit HDOJ 1061 1005 Fibonacci Again HDOJ 1021 1006 Number Sequence HDOJ 1005 1007 The area HDOJ 1071 1008 吃糖果HDOJ 1205 1009 Sky数HDOJ 2097 1010 Box of Bricks HDOJ 20881011 简易版之最短距离HDOJ 20831012 Fibbonacci Number HDOJ 20701013 Coin Change HDOJ 20691014 A + B Again HDOJ 20571015 Lowest Common Multiple Plus HDOJ 20281016 Can you solve this equation? HDOJ 21991017 Strange fuction HDOJ 28991018 Pseudoprime numbers HDOJ 19051019 Delta-wave HDOJ 10301020 月之数HDOJ 25021021 又见GCD HDOJ 25041022 找新朋友HDOJ 12861023 七夕节HDOJ 12151024 完数HDOJ 1406三、递推求解1001 超级楼梯HDOJ 20411002 不容易系列之二HDOJ 20421003 一只小蜜蜂... HDOJ 20441004 不容易系列之(3)——LELE的RPG难题HDOJ 20451005 骨牌铺方格HDOJ 20461006 折线分割平面HDOJ 20501007 母牛的故事HDOJ 20181008 下沙的沙子有几粒?HDOJ 12671009 自共轭Ferrers图HDOJ 12461010 汉诺塔II HDOJ 12071011 悼念512汶川大地震遇难同胞——重建希望小学HDOJ 2190 1012 Children’s Queue HDOJ 12971013 Tiling_easy version HDOJ 25011014 统计问题HDOJ 25631015 Buy the Ticket HDOJ 11331016 Game of Connections HDOJ 11341017 Computer Transformation HDOJ 10411018 Children’s Queue HDOJ 12971019 The Number of Paths HDOJ 12931020 "下沙野骆驼"ACM夏令营HDOJ 129四、简单典型DP1001 数塔HDOJ 20841002 Super Jumping! Jumping! Jumping! HDOJ 10871003 免费馅饼HDOJ 11761004 Common Subsequence HDOJ 11591005 搬寝室HDOJ 14211006 Humble Numbers HDOJ 10581007 Max Sum HDOJ 10031008 Max Sum Plus Plus HDOJ 10241009 FatMouse's Speed HDOJ 11601010 Bone Collector HDOJ 26021011 Piggy-Bank HDOJ 11141012 I NEED A OFFER! HDOJ 12031013 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活HDOJ 2191 1014 Coins HDOJ 2844五、简单博弈1001 Brave Game HDOJ 18461002 Good Luck in CET-4 Everybody! HDOJ 18471003 Fibonacci again and again HDOJ 18481004 Rabbit and Grass HDOJ 18491005 Being a Good Boy in Spring Festival HDOJ 18501006 kiki's game HDOJ 21471007 Public Sale HDOJ 21491008 悼念512汶川大地震遇难同胞——选拔志愿者HDOJ 21881009 丑数游戏1010 YLF's Game六、半程测试1001 CD HDOJ 37631002 Alaska HDOJ 37641003 Celebrity Split HDOJ 37651004 Knight's Trip HDOJ 37661005 Paintball HDOJ 37671006 Shopping HDOJ 37681007 Stack Machine HDOJ 37691008 Ideas HDOJ 37701009 HST HDOJ 37711010 Tunnelling the Earth H DOJ 3772七、母函数1001 Ignatius and the Princess III HDOJ 10281002 Square Coins HDOJ 13981003 Holding Bin-Laden Captive! HDOJ 10851004 Big Event in HDU HDOJ 11711005 Fruit HDOJ 21521006 The Balance HDOJ 1709八、并查集1001 How Many Tables HDOJ 1213 1002 小希的迷宫HDOJ 1272 1003 Is It A Tree? HDOJ 1325 1004 More is better HDOJ 1856 1005 Constructing Roads HDOJ 1102 1006 畅通工程HDOJ 1232 1007 还是畅通工程HDOJ 1233 1008 畅通工程HDOJ 1863 1009 畅通工程再续HDOJ 1875 1010 继续畅通工程HDOJ 1879共26 + 24 + 20 + 14 + 10 + 6 + 10 = 110 题。

acm竞赛试题及答案

acm竞赛试题及答案

acm竞赛试题及答案ACM(Association for Computing Machinery)竞赛是一项全球性计算机科学竞赛,旨在锻炼参赛者的问题解决能力和编程技巧。

每年都有数千名来自不同学校的学生参加这一挑战。

本文将提供一些最近的ACM竞赛试题以及相应的答案,帮助读者了解和学习竞赛题目的类型和解题思路。

1. 问题描述给定一个由N个整数组成的数组A,请编写一个程序,找出数组中两个不同元素的差的最小值。

2. 输入格式- 第一行包含一个整数N,表示数组A的长度。

- 第二行包含N个以空格分隔的整数,表示数组A中的元素。

3. 输出格式输出一个整数,表示数组中两个不同元素的差的最小值。

4. 示例输入:51 52 9 12输出:15. 解题思路该问题可以通过对数组进行排序,并比较相邻两个数的差值来求解。

首先,将数组A进行升序排序。

然后,遍历排序后的数组,依次计算相邻两个数的差值,并记录其中的最小值。

最后,返回这个最小差值即可。

6. 代码实现```pythondef min_difference(nums):nums.sort() # 对数组进行升序排序min_diff = float('inf') # 初始化最小差值为正无穷大for i in range(len(nums)-1):diff = abs(nums[i] - nums[i+1]) # 计算相邻两个数的差值min_diff = min(min_diff, diff) # 更新最小差值return min_diff# 输入处理N = int(input())A = list(map(int, input().split()))# 调用函数并输出结果result = min_difference(A)print(result)```7. 答案解析对给定的数组进行排序后,遍历数组计算相邻两个数的差值,并记录其中的最小值。

上述代码中,首先将数组A进行升序排序,然后使用一个变量`min_diff`来记录最小差值。

杭电ACM试题详细分类,杭电oj详细分类,hdu详细分类,详细,ACM.doc

杭电ACM试题详细分类,杭电oj详细分类,hdu详细分类,详细,ACM.doc

杭电ACM试题分类枚举1002 10041013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 10391042 10471048 1049 1050 1057 1062 1063 1064 1070 1073 1075 1082 1083 10841088 11061107 1113 1117 1119 1128 1129 1144 1148 1157 1161 1170 1172 117711971200 1201 1202 1205 1209 1212(大数取模)1216 (链表)1218 1219 12251228 12291230 1234 1235 1236 1237 1239 1250 1256 1259 1262 1263 1265 12661276 1279 1282 1283 1287 1296 1302 1303 1304 1305 1306 1309 1311 1314搜索,递归求解1010 1016 1026 1043(双广)1044 (BFS+DFS) 1045 1067 1072 1104 1175 1180 11951208 1226 1238 1240 1241 1242 1258 1271 1312 1317动态规划1003 1024 1025 1028 1051 1058 1059 1069 1074 1078 1080 1081 1085 1087 1114 1158 1159 1160 1171 1176 1181 1203 1224 1227 1231 1244 1248 1253 1254 1283 1300数学,递推,规律1005 1006 1012 1014 1018 1019 1021 1023 1027 1030 1032 1038 1041 1046 1059 1060 1061 1065 1066 1071(微积分)1097 1098 1099 1100 1108 1110 1112 1124 1130 1131 1132 1134 1141 1143 1152 1155(物理题)1163 1165 1178 1194 1196(lowbit) 1210 1214 1200 1221 1223 1249 1261 1267 1273 1290 1291 1292 1294 1297 1313 1316数论1164 1211 1215 1222 1286 1299计算几何1086 1115 1147贪心1009 1052 1055 1257 并查集11981213 1232 1272线段树,离散化11991255图论最短路相关的问题1142 1162 1217 1301二分图问题1054 1068 1150 1151 1281其他1053 (huffman) 1102(MST) 1116 (欧拉回路)1233(MST) 1269 (强连通)数据结构1103 (堆+模拟)1166 (数状树组)1247 1251 1285 (Topol) 1298以下是详细介绍1002简单的大数1003 DP经典问题,最大连续子段和1004简单题1005找规律(循环点)1007经典问题,最近点对问题,用分治1008简单题1010搜索题,剪枝很关1009贪心1012简单题1013简单题(有个小陷阱)1014简单题1015可以看作搜索题吧1016经典的搜索1017简单数学题1018简单数学题1019简单数学题1020简单的字符串处理找规律的数学题数据结构的题(栈的应用)特殊的数(Catalan Number)经典DP,最大M 子段和经典DP,最长递增子序列(要用NLogN的方法过)搜索数学题(或用STL)经典问题,整数拆分,用母函数做简单题(一般方法容易超时)简单题,可用模拟过简单题简单题模拟题Candy Sharing Game模拟题简单题简单题,不是一般的简单简单题字符串处理简单题,排序简单题,用大数大数经典搜索题,八数码问题稍微有点麻烦的搜索题搜索题,可用匹配做简单题简单的大数简单字符串处理简单题贪心经典贪心,也可以用DP贪心贪心,关于Huffman编码二分匹配二分匹配简单题模拟题经典问题,丑数,DP经典问题,可以用母函数或DP (不针对题目优化都会超时)数学题数学题简单字符串处理模拟大数简单题1065简单题1066数学题,找规律1068经典二分匹配1069经典DP1070简单题1071简单数学题1072搜索1073字符串处理1074 DP1075字典树1076简单题1078DP1079博弈(DP)1080DP 1081经典DP1082简单题1083二分匹配1084简单题1085母函数1086简单几何题1087简单DP1088字符串处理1089~1096 (练习输入输出的8个题目)1097简单数学题1098数学题,注意找规律1099数学HrH1500DP1501DP1502DP or记忆化1503DP1504模拟1505DP1506DP15072分匹配1508记忆化容易点1509模拟1510 DP1511搜索可以过1512左偏树1513DP1514DP1515DFS1516DP1517博奕搜索DP (不确定)树状DP 数学题稳定婚姻DP 博弈博弈Maxflow博弈2分匹配简单题最大团差分约束Maxflow入门题KM Or > 小费用流差分约束差分约束博弈模拟加置换群的理论CODE可以短些,其实没必要。

ACM题目分类

ACM题目分类
三.数据结构.
(1)串 (poj1035,poj3080,poj1936)
(2)排序(快排、归并排(与逆序数有关)、堆排) (poj2388,poj2299)
(3)简单并查集的应用.
(4)哈希表和二分查找等高效查找法(数的Hash,串的Hash)
(3)点集最小圆覆盖.
(4)对踵点(poj2079)
八.综合题.
(poj3109,poj1478,poj1462,poj2729,poj2048,poj3336,poj3315,poj2148,poj1263)
同时由于个人练习的时候可能有些偏向性,可能上面的总结不是很全,还请大家提出和指正,而且由于ACM的题目中专门针对某个算法的题目可能比较少出现,所以上面的分类中的题有可能有多种解法或者是一些算法的综合,这都不会影响大家做题,希望练习的同学能够认真,扎实地训练,做到真正的理解算法,掌握算法. 同时在论坛上还有许多前辈的分类,总结,大家也可以按自己的情况采用.注意FTP上有很多的资料,希望大家好好地利用.
目的). (poj2823)
(4)左偏树(可合并堆).
(5)后缀树(非常有用的数据结构,也是赛区考题的热点).
(poj3415,poj3294)
四.搜索
(1)较麻烦的搜索题目训练(poj1069,poj3322,poj1475,poj1924,poj2049,poj3426)
(5)杂题.
(poj1870,poj3296,poj3286,poj1095)
七.计算几何学.
(1)坐标离散化.
(2)扫描线算法(例如求矩形的面积和周长并,常和线段树或堆一起使用).
(poj1765,poj1177,poj1151,poj3277,poj2280,poj3004)

acm大赛历年程序题

acm大赛历年程序题

acm大赛历年程序题
ACM大赛是一项计算机竞赛,每年都会发布一系列的程序题供
参赛者解答。

这些题目涵盖了各个计算机科学领域的知识,包括数
据结构、算法、图论、动态规划、数学等等。

以下是一些历年ACM
大赛的程序题的例子:
1. 最短路径问题,给定一个有向带权图,求两个节点之间的最
短路径。

可以使用Dijkstra算法或者Floyd-Warshall算法来解决。

2. 字符串处理问题,给定一个字符串,要求对其进行特定的处理,比如反转、删除重复字符等。

可以使用字符串操作和遍历来解决。

3. 数组操作问题,给定一个数组,要求对其进行特定的操作,
比如排序、查找最大/最小值、计算数组的平均值等。

可以使用排序
算法、查找算法和遍历来解决。

4. 动态规划问题,给定一个问题和一组限制条件,要求找到满
足条件的最优解。

可以使用动态规划的思想,将问题拆分成子问题
并逐步求解。

5. 图论问题,给定一个图,要求对其进行特定的操作,比如查找连通分量、判断是否存在环等。

可以使用图的遍历和深度优先搜索或广度优先搜索来解决。

6. 数学问题,给定一个数学问题,要求求解或验证某个数学定理或公式。

可以使用数学运算和推导来解决。

这些只是一小部分例子,ACM大赛的题目类型非常多样化,每年都会有新的题目发布。

参赛者需要具备扎实的计算机科学基础知识和良好的编程能力,才能在规定时间内解决这些问题。

ACM几道练习题及其答案

ACM几道练习题及其答案

…………………………………………………………………………………………………….. 标题:HDU- 1001-Sum Problem代码:#include <stdio.h>#include <iostream>#include <algorithm>#include <ctype.h>using namespace std;int main(){//freopen("text.txt","r",stdin);int sum,i;while(scanf("%d",&i)!=EOF){if((i+1)%2==0)sum=(i+1)/2*i;elsesum=i/2*(i+1);printf("%d\n\n",sum);}//fclose(stdin);return 0;}…………………………………………………………………………………………………….. …………………………………………………………………………………………………….. 标题:HDU-2027-代码:#include <stdio.h>#include <iostream>#include <algorithm>#include <ctype.h>using namespace std;int main(){//freopen("text.txt","r",stdin);char c[101];int n,j,k,a,e,i,o,u;scanf("%d\n",&n);//注意这里for(j=1;j<=n;j++){a=e=i=o=u=0;gets(c);for(k=0;c[k]!='\0';k++){if(c[k]=='a')a++;if(c[k]=='e')e++;if(c[k]=='i')i++;if(c[k]=='o')o++;if(c[k]=='u')u++;}printf("a:%d\ne:%d\ni:%d\no:%d\nu:%d\n",a,e,i,o,u);if(j<n)printf("\n");}//fclose(stdin);return 0;}…………………………………………………………………………………………………….. …………………………………………………………………………………………………….. 标题:HDU-2025- 查找最大元素代码:#include <stdio.h>#include <iostream>#include <algorithm>#include <ctype.h>using namespace std;int main(){//freopen("text.txt","r",stdin);char a[105],max='A';int i,n;while(scanf("%s",a)!=EOF){n=strlen(a);max='A';for(i=0;i<n;i++){if(a[i]>max) max=a[i];}for(i=0;i<n;i++){printf("%c",a[i]);if(a[i]==max)printf("(max)");}printf("\n");}//fclose(stdin);return 0;}…………………………………………………………………………………………………….. …………………………………………………………………………………………………….. 标题:HDU-1037-Keep on Truckin'代码:#include <stdio.h>#include <iostream>#include <algorithm>#include <ctype.h>using namespace std;int main(){//freopen("text.txt","r",stdin);int a,b,c,min;while(cin >> a >> b >> c){min = a>b?b:a;min = min>c?c:min;if(min<=168)printf("CRASH %d\n",min);elseprintf("NO CRASH\n");}//fclose(stdin);return 0;}…………………………………………………………………………………………………….. …………………………………………………………………………………………………….. 标题:HDU-2052-Picture代码:#include <stdio.h>#include <iostream>#include <algorithm>#include <ctype.h>using namespace std;int main(){//freopen("text.txt","r",stdin);int n,m,i;while(scanf("%d%d",&n,&m)!=EOF){printf("+");for(i=0;i<n;++i){printf("-");}printf("+\n");for(i=0;i<m;++i){printf("|");for(int j=0;j<n;++j){printf(" ");}printf("|\n");}printf("+");for(i=0;i<n;++i){printf("-");}printf("+\n\n");}//fclose(stdin);return 0;}…………………………………………………………………………………………………….. …………………………………………………………………………………………………….. 标题:HDU-1034-Candy Sharing Game代码:#include <stdio.h>#include <iostream>#include <algorithm>#include <ctype.h>using namespace std;const int MAXN=1000;int a[MAXN];int main(){//freopen("text.txt","r",stdin);int n;int i;while(scanf("%d",&n),n){for(i=0;i<n;i++) scanf("%d",&a[i]);int res=0;while(1){for(i=1;i<n;i++)if(a[i-1]!=a[i]) break;if(i>=n) break;res++;int temp=a[n-1]/2;for(i=n-1;i>0;i--){a[i]/=2;a[i]+=a[i-1]/2;}a[0]/=2;a[0]+=temp;for(i=0;i<n;i++)if(a[i]&1) a[i]++;}printf("%d %d\n",res,a[0]);}//fclose(stdin);return 0;}……………………………………………………………………………………………………..。

acm程序设计大赛试题

acm程序设计大赛试题

acm程序设计大赛试题ACM程序设计大赛试题是计算机科学领域中的一项重要竞赛活动,旨在选拔和培养具有优秀编程能力和创新思维的学生。

这项比赛既考察参赛选手解决实际问题的能力,又对他们的编程技巧、算法设计和计算机知识有着较高的要求。

本文将介绍ACM程序设计大赛试题的特点和题目类型。

一、ACM程序设计大赛试题的特点ACM程序设计大赛试题具有以下几个特点:1. 实际问题背景:ACM程序设计大赛试题往往以实际问题为基础,模拟真实世界中的场景,让选手能够将所学知识应用到实际中去。

2. 多样性:ACM程序设计大赛试题涵盖了多个领域的问题,如图论、动态规划、贪心算法等,选手需要具备广泛的知识储备和灵活的思维方式。

3. 时间限制:ACM程序设计大赛试题通常要求选手在有限的时间内解决问题,这既考验了选手对问题的理解能力,也考察了他们的编程速度和应变能力。

二、ACM程序设计大赛试题的题目类型ACM程序设计大赛试题的题目类型多种多样,以下是其中几个常见的类型:1. 编程题:选手需要根据题目要求,设计算法并编写代码解决问题。

这类题目旨在考察选手的编程能力和算法设计思维。

2. 选择题:选手需要在给定的选项中选择正确答案,这类题目常常涉及到基础的计算机知识和数据结构。

3. 填空题:选手需要根据题目要求,在给定的空格中填入适当的代码或数值,这类题目考察选手对编程语言和计算机原理的理解程度。

4. 简答题:选手需要对给定问题进行理论分析,并进行文字解释或证明,这类题目考察选手的理解能力和表达能力。

三、ACM程序设计大赛试题的难度ACM程序设计大赛试题的难度各有不同,通常分为初级、中级和高级三个层次,以满足不同年级和专业背景的选手需求。

初级试题注重基础知识和算法简单实现,中级试题涉及到较为复杂的数据结构和算法设计,高级试题则对选手的编程能力和创新思维提出更高要求。

四、参加ACM程序设计大赛的意义参加ACM程序设计大赛对学生有着重要的意义:1. 锻炼编程能力:参加ACM程序设计大赛能够提升选手的编程技巧和实际问题解决能力。

杭电ACM博弈题合集

杭电ACM博弈题合集

杭电ACM博弈题合集hdu博弈,这些题都不难。

属于博弈简单题。

hdu1846巴什博弈,n%(m+1)==0先手必败。

#include#include#include#include#includeusing namespace std;int main(){int n,a,b;scanf("%d",&n);while(n--){scanf("%d%d",&a,&b);if(a%(b+1)==0)printf("second\n");else printf("first\n");}return 0;}hdu1847只要留下两类都是2的指数幂,就是必输状态,然后找规律,发现这两类的和为3的倍数。

即有下面的结论。

#include#include#includeusing namespace std;int main(){int n;while(scanf("%d",&n)!=EOF) {if(n%3==0)printf("Cici\n");else printf("Kiki\n");}return 0;}hdu1848#include#include#include#includeusing namespace std;#define N 1005int f[N];int sg[N];void fun(){int i;f[0]=1;f[1]=1;f[2]=2;for(i=3;;i++){f[i]=f[i-1]+f[i-2];if(f[i]>1000)break;}}int dfs(int v){int i;if(sg[v]!=-1)return sg[v];bool visit[N]={0};for(i=1;i<16;i++){if(v>=f[i]){int temp=dfs(v-f[i]);visit[temp]=1;}}for(i=0;visit[i];i++);return sg[v]=i;}int main(){fun();int m,n,p;while(scanf("%d%d%d",&m,&n,&p),m||n||p) { memset(sg,-1,sizeof(sg));int ans;ans=dfs(m)^dfs(n)^dfs(p);if(ans)printf("Fibo\n");else printf("Nacci\n");}return 0;}hdu1849裸的NIM博弈,直接异或即可。

hdoj详细题目ACM分类超级经典题目分类

hdoj详细题目ACM分类超级经典题目分类

hdu 题目分类1001 整数求和 水题1002 C 语言实验题——两个数比较 水题1003 1、2、3、4、5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze 广度搜索1006 Redraiment 猜想 数论:容斥定理1007 童年生活二三事 递推题 1008 University 简单hash 1009 目标柏林 简单模拟题 1010 Rails 模拟题(堆栈) 1011 Box of Bricks 简单题1012 IMMEDIATE DECODABILITY Huffman 编码1013 STAMPS 搜索or 动态规划 1014 Border 模拟题1015 Simple Arithmetics 高精度计算 1016 Shoot-out 博弈+状态压缩DP 1017 Tour Guide 1018 Card Trick 简单题1019 Necklace Decomposition 贪心1020 Crashing Robots 模拟题1021 Electrical Outlets 简单题 1022 Watchdog 简单题1023 Taxi Cab Scheme 图论:最小路径覆盖--->最大二分匹配1024 Pseudo-random Numbers 数论 1025 Card Game Cheater 简单题 1026 Investment 动态规划 1027 Pipes1028 SETI 数学:高斯消元法1029 Minimax Triangulation 计算几何 1030 Unequalled Consumption 母函数 1031 Declaration of Content 1032 Laserbox 搜索:DFS 1033 Bowlstack 1034 Pesky Heroes1035 Reduced ID Numbers 暴力 1036 Tantrix1037 Guardian of Decency 图论:匈牙利算法求二分图的最大匹配1038 Up the Stairs 简单数学题 1039 Sudoku 搜索:DFS 1040 The SetStack Computer 1041 Pie 二分法1042 Ticket to Ride 动态规划 1043 The Bookcase 动态规划 1044 Printer Queue 模拟题 1045 Prime Path 搜索:BFS1046 Lineland's Airport 1047 Leonardo's Notebook 数学题:群置换 1048 简易版最长序列 简单题 1049 Jesse's problem 搜索:DFS 1050 Error Correction 模拟题 1051 A × B problem 高精度计算 1052 Redraiment 的走法 动态规划 1053 Word Encoding 动态规划 1054 Jesse's Code 组合数学:排列 1055 简单密码破解 水题1056 英文金曲大赛 水题 1057 有假币 水题 1058 寄居蟹与海葵 水题1059 天仙配 水题1060 鹊桥相会 水题 1061 杨辉三角 水题 1062 蟠桃记 水题1063 养兔子 水题 1064 字符统计 水题 1065 完美数 水题 1066 亲和数 水题 1067 成绩评估 水题 1068 找零钱 水题 1069 漂亮菱形 水题 1070 Least Common Multiple 水题 1071 第几天 水题 1072 编辑距离 水题1073 支配值数目 水题 1074 等值数目 水题 1075 两数组最短距离 水题 1076 输入入门(1) 水题 1077 输入入门(2) 水题 1078 输入入门(3) 水题 1079 输出入门 水题1080 Counterfeit Dollar 组合数学 1081 Dividing 动态规划 1082 Sorting It All Out 图论:拓扑排序 1083 False coin 暴力法 1084 File Mapping 1085 Color Me Less 简单题1086 Round and Round We Go 简单题 1087 Microprocessor Simulation 简单题 1088 求奇数的乘积 水题 1089 平方和与立方和 水题1090 绝对值排序 水题 1091 JudgeOnline 水题 1092 More Beautiful 水题 1093 猴子分桃 水题 1094 C 语言实验题——一元二次方程 水题 1095 C 语言实验题——保留字母 水题 1096 C 语言实验题——排列 水题 1097 C 语言实验题——矩阵转置 水题 1098 C 语言实验题——素数 水题1099 Ambiguous permutations 简单题 1100 Home Work 贪心法1101 Redraiment 的遭遇 数学题:找规律 1102 Decorate the wall 搜索or 动态规划 1103 Economic phone calls 动态规划or 贪心 1104 Any fool can do it 记忆化搜索 1105 Wine trading in Gergovia 贪心法 1106 Homogeneous squares 随机算法 1107 Automatic Correction of Misspellings 字符串1108 Black and white painting 简单数学题 1109 Cylinder 计算几何:公式推导 1110 Deli Deli 水题1111 Expressions 数据结构:树的遍历 1112 Flavius Josephus Reloaded 数论:Pollard's R1113 Annoying painting tool 贪心法 1114 Frequent values RMQ 区间最值问题 OR 线段树1115 Anagram Groups 字符串匹配 1116 Let it Bead 组合数学->Polya 定理 1117 Simple Computers 简单题 1118 Mondriaan's Dream 动态规划 1119 Equidistance 计算几何 1120 How many Fibs? 高精度计算 1121 Hike on a Graph 搜索:BFS 1122 ASCII Art 1123 Billing Tables1124 Cellular Automaton 矩阵计算1125 Exchange 1126 Fool's Game 1127 Java vs C++ 字符串处理 1128 Kickdown 字符串处理 1129 Copying Books 贪心+二分法1130 Adding Reversed Numbers 简单题 1131 Glass Beads 字符串的最小表示 1132 The Circumference of the Circle 计算几何题 1133 Knight Moves 搜索:BFS 1134 Eeny Meeny Moo 变形的约瑟夫问题 1135 Lotto 组合数学1136 Humble Numbers 动态规划 1137 Average is not Fast Enough! 简单题 1138 Etaoin Shrdlu 简单题 1139 Hard to Believe, but True! 简单题 1140 Code the Tree 简单题 1141 Fiber Network 图论:全源最短路径,Floyd-Warshall 算法 1142 Global Roaming 3D 几何题 1143 All in All 字符串处理1144 The Sierpinski Fractal 递归 1145 Assistance Required 简单题:预处理 1146 Drink, on Ice 模拟题 1147 All Discs Considered 搜索:BFS 1148 In Danger 模拟题 1149 Run Length Encoding 字符串处理 1150 Bee Maja 模拟题 1151 Friends 表达式求值 1152 John 博弈论 1153 Double Queue 最大堆与最小堆 1154 ‘JBC’1155 Loan Scheduling 贪心+堆 1156 Showstopper 1157 Highway 贪心法 1158 Computers 动态规划 1159 The Stable Marriage Problem 组合数学 1160 Arne Saknussemm 模拟题 1161 Sum Problem 水题 1162 Fire Net 搜索题 1163 统计1到N 之间数字1的个数 推理题 1164 最大公因子 水题1165 C 语言实验题——三个整数 水题 1166 C 语言实验题——大小写转换 水题 1167 C 语言实验题——分数序列 水题 1168 C 语言实验题——最值 水题 1169 C 语言实验题——保留整数 水题 1170 C 语言实验题——矩阵下三角元素之和 水题 1171 C 语言实验题——字符逆序 水题 1172 C 语言实验题——打印菱形 水题 1173 C 语言实验题——分割整数 水题 1174 C 语言实验题——删除指定字符 水题 1175 C 语言实验题——时间间隔 水题 1176 C 语言实验题——数组逆序 水题 1177 C 语言实验题——打印数字图形 水题 1178 C 语言实验题——单词统计 水题 1179 C 语言实验题——最小公倍数和最大公约数 水题 1180 Crashing Balloon 搜索题1181 念数字 模拟题1182 A+B for Input-Output Practice(1) 水题 1183 Anagrams by Stack 搜索:回溯 1184 Elevator 数学:找规律1185 Substrings 字符串处理1186 Calling Extraterrestrial Intelligence Again 搜索:枚举法 1187 Do the Untwist 简单数学题 1188 数字对 水题 1189 A+B for Input-Output Practice (2) 水题 1190 火星A+B 简单题1191 三齿轮问题:三个齿轮啮合 简单数学题 1192 A + B Problem II 高精度计算 1193 The ones to remain 数学题 1194 Chinese Chess 博弈论1195 Page Replacement 数据结构:队列or hash 1196 RSA Signing 数论:Pollard's Rho 算法 1197 Number Guessing 搜索:穷举 1198 求n 的阶乘 高精度计算 1199 Area 计算几何 1200 求两直线的夹角 水题 1201 三角形面积 水题 1202 Max Sum 动态规划 1203 Number Sequence 大数问题1204 u Calculate e 水题 1205 斐波那契数列 高精度计算 1206 Fibonacci Again 大数问题 1207 Let the Balloon Rise 字符串处理 1208 还是A+B 水题1209 A + B 水题1210 The area 简单计算几何1211 Ignatius's puzzle 简单数学问题 1212 Computer Transformation 高精度计算 1213 N! 高精度计算 1217 Text Reverse 水题 1220 填数字游戏 搜索:DFS1221 Tempter of the Bone 搜索:DFS or BFS+剪枝 1226 Last non-zero Digit in N! 数论 1227 三角形 递推求解 1228 回文数猜想 简单题 1229 Factorial 简单题 1230 Specialized Four-Digit Numbers 简单数学题 1231 Lowest Bit 简单题1232 To and Fro 简单题 1233 AC Me 简单题1234 Wolf and Rabbit 数论1235 最大连续子序列 动态规划 1236 开门人和关门人 字符串处理 1237 排名 排序1238 统计难题 字符串处理:字典树1239 Tick and Tick 数学题 1240 Quoit Design 分治法1241 钱币兑换问题 递推求解 1242 求出前m 大的数 简单题 1243 角谷猜想 简单题1244 Reverse Number 简单题1245 寻找素数对 简单题 1246 ZJUTACM 简单题1247 Hat's Fibonacci 高精度计算1248 Encoding 简单题 1249 四数相加 高精度计算 1250 两数相减 高精度计算1251 Square Coins 母函数 1252 Counting Triangles 递推求解 1253 2^x mod n = 1 数论:费尔马小定理 1254 Minimum Inversion Number 简单题 1255 Surround the Trees 计算几何:凸包 1256 Number Steps 简单题 1257 Binary Numbers 简单题 1258 Knight Moves 搜索:BFS 1259 Lotto 组合数学 1260 A Simple Task 简单题 1261 The Drunk Jailer 数论1262 Hanoi Tower Troubles Again! 递推求解 1263 IBM Minus One 水题1264 Definite Values 简单题 1265 Box of Bricks 水题 1266 Perfection 简单题 1267 Reverse Text 水题 1268 Inversion 模拟题1269 Prime Cuts 简单题1270 How Many Fibs? 高精度计算1271 Round and Round We Go 简单题 1272 Red and Black 搜索:DFS 1273 What Day Is It? 简单题1274 String Matching 字符串匹配 1275 A Contesting Decision 简单题 1276 Doubles 简单题 1277 The Snail 简单题1278 Jungle Roads 图论:最小生成树 1279 Prime Ring Problem 搜索:DFS 1280 Big Number 大数问题 1281 Least Common Multiple 简单题 1283 简单排序 水题 1284 Gridland 简单题 1285 An Easy Task 简单题 1286 Calendar Game 模拟题1287 Human Gene Functions 动态规划 1288 计算几何练习题——线段相交 计算几何 1289 计算几何练习题——线段相交II 计算几何 1290 计算几何练习题——直线交点 计算几何 1291 Trees Made to Order 递归求解 1292 排序 简单题 1293 18岁生日 简单题 1294 吃糖果 递推求解 1295 变种汉诺塔 递推求解 1296 洗牌 递推求解 1297 大数求余 数论 1298 圆桌会议 递推求解 1299 畅通工程 并查集 1300 还是畅通工程 最小生成树 1301 统计同成绩学生人数 水题1302 简单计算器 表达式求值:栈的应用 1303 改进版计算器 表达式求值:栈的应用 1304 FatMouse' Trade 贪心法 1305 Digital Roots 大数问题 1306 Uniform Generator 数论 1307 A Mathematical Curiosity 穷举法 1308 Safecracker 穷举法 1309 The 3n + 1 problem 简单题 1310 分享糖果 模拟题 1311 宝物收集 搜索:BFS 1312 Climbing Worm 简单题 1313 搬桌子 贪心法1314 Humble Numbers 动态规划 1315 Dividing 动态规划1316 Rightmost Digit 数学问题 1317 Leftmost Digit 数学问题 1318 Hangover 简单数学问题1319 Exponentiation 高精度计算 1320 I Think I Need a Houseboat 简单题 1321 Girls and Boys DFS+二分图 1322 Monkey and Banana 动态规划 1323 买牛奶 简单题 1324 Matrix Chain Multiplication 数据结构:栈的应用 1325 计算成绩 简单题1326 Holding Bin-Laden Captive! 母函数 1327 You can Solve a Geometry Problem too 计算几何 1328 Super Jumping! Jumping! Jumping! 动态规划 1329 a^b 数论 1330 计算GPA 水题1331 Give me an offer! 动态规划:0-1背包 1332 田忌赛马 贪心法 1333 Asteroids! 搜索:BFS 1334 Oil Deposits 搜索:DFS 1335 营救天使 搜索:BFS 1336 小数化分数 高精度计算 1337 I Hate It 线段树 1338 Strange Billboard 位运算+枚举 1339 Frobenius 递推求解 1340 奇怪的公式 数学题 1341 Fibonacci again and again 博弈论 1342 A New Tetris Game 博弈论 1343 Sum It Up 搜索:DFS 1344 速算24点 搜索 1345 推箱子 搜索:BFS1346 Pushing Boxes 搜索:BFS 1347 The Worm Turns 搜索 1348 Alfredo's Pizza Restaurant 简单题 1349 Broken Keyboard 字符串处理 1350 Convert Kilometers to Miles 简单题 1351 单词数 水题1352 仙人球的残影 简单题 1353 Family planning 简单题1354 Rout 66 简单题 1355 LC-Display 模拟题 1356 A == B ? 高精度计算 1357 不容易系列之一 递推求解 1358 折线分割平面 递推求解1359 find the nth digit 二分查找 1360 奇数阶魔方(II) 简单题 1361 Keep on Truckin' 简单题 1362 Factstone Benchmark 简单题1363 Destroy the Well of Life 模拟题 1365 Brave Game 博弈论 1366 ASCII 码排序 水题 1367 计算两点间的距离 水题1368 计算球体积 水题 1369 求绝对值 水题 1370 数值统计 水题1371 求数列的和 水题1372 水仙花数 水题 1373 多项式求和 水题 1374 素数判定 水题 1375 偶数求和 水题 1376 母牛的故事 水题 1377 数列有序! 水题 1378 发工资咯:) 水题 1379 C 语言合法标识符 水题 1380 海选女主角 水题 1381 查找最大元素 水题 1382 首字母变大写 水题1383 统计元音 水题1384 Palindromes _easy version 水题 1385 汉字统计 水题 1386 进制转换 水题1387 人见人爱A+B 水题 1388 人见人爱A-B 水题 1389 人见人爱A^B 水题 1390 改革春风吹满地 计算几何 1391 今年暑假不AC 动态规划 1392 三角形 水题1393 求平均成绩 水题1394 不容易系列之二 递推求解 1395 密码 水题1396 一只小蜜蜂... 递推求解 1397 不容易系列之(3)—— LELE 的RPG 难题 递推求解1398 骨牌铺方格 递推求解 1399 阿牛的EOF 牛肉串 递推求解 1400 神、上帝以及老天爷 递推求解 1401 不容易系列之(4)——考新郎 递推求解 1402 Bitset 简单题 1403 Picture 简单模拟题1404 Switch Game 找规律1405 An easy problem 简单模拟题 1406 A + B Again 简单题 1407 The sum problem 简单数学题 1408 龟兔赛跑 动态规划 1409 Snooker 简单数学题 1410 Subset sequence 简单题 1411 汉诺塔III 递推求解 1412 "红色病毒"问题 递推求解 1413 小兔的棋盘 递推求解 1414 RPG 的错排 错排+排列组合 1415 无限的路 简单题 1416 夹角有多大 数学题 1417 汉诺塔IV 递推求解 1418 复习时间 简单题 1419 选课时间 暴力求解 1420 手机短号 字符串处理 1421 找单词 母函数1422 简易版之最短距离 数学题 1423 数塔 动态规划 1424 核反应堆 简单题 1425 A1 = ? 公式推导 1426 剪花布条 字符串处理 1427 不要62 数学题 1428 空心三角形 字符串处理 1429 小明A+B 简单题 1430 Sky 数 进制转换 1431 整除的尾数 简单题 1432 分拆素数和 数论 1433 正整数解 数学题 1434 挂盐水 模拟题 1435 {A} + {B} 简单题 1436 小数A+B 高精度计算 1437 Zigzag 简单题 1438 螺旋形 简单题 1439 行李寄存 简单题 1440 判断多边形凹凸 计算几何 1441 The centre of polygon 计算几何 1442 最小正整数 简单题 1443 Elevator Stopping Plan 二分+贪心法 1444 TOYS 计算几何 1445 The Doors 计算几何 1446 Polygon And Segment 计算几何 1447 Fence 计算几何 1448 两圆相交面积 计算几何1449 Area of Circles 计算几何 1450 Pipe 计算几何1451 zero sum 搜索:DFS1452 C 语言实验题——Hello World 水题 1453 C 语言实验题——数日子 水题 1454 C 语言实验题——三个数排序 水题 1455 C 语言实验题——数字串求和 水题 1456 C 语言实验题——拍皮球 水题 1457 C 语言实验题——求一个3*3矩阵对角线元素之和 水题1458 C 语言实验题——数组逆序 水题 1459 C 实验题——求最大值 水题 1460 C 实验题——求绝对值最大值 水题 1461 C 语言实验题——求平均值 水题 1462 C 语言实验题——打印直角三角形 水题 1463 C 语言实验题——相加和最大值 水题 1464 C 语言实验题——简单编码 水题 1465 C 语言实验题——某年某月的天数 水题 1466 C 语言实验题——各位数字之和排序 水题 1467 C 语言实验题——两个数最大 水题 1468 C 语言实验题——求级数值 水题 1469 Pipe II 计算几何 1470 Transmitters 计算几何 1471 Wall 计算几何1472 C 语言实验题——逆置正整数 水题 1473 C 语言实验题——找中间数 水题 1474 C 语言实验题——整数位 水题 1475 C 语言实验题——一元二次方程 II 水题 1476 C 语言实验题——圆周率 水题 1477 C 语言实验题——余弦 水题 1478 C 语言实验题——打印金字塔 水题 1479 C 语言实验题——排序 水题 1480 C 语言实验题——约瑟夫问题 水题 1481 C 语言实验题——鞍点 水题 1482 C 语言实验题——计算表达式 水题 1483 C 语言实验题——汉诺塔 水题 1484 C 语言实验题——字符串排序 水题 1485 C 语言实验题——整除 水题 1486 Solitaire 搜索:(双向)BFS 1487 Abbreviation 水题1488 C 语言实验题——买糖果 水题 1489 C 语言实验题——字符编码 水题 1490 C 语言实验题——合法的C 标识符 水题 1491 C 语言实验题——三角形面积 水题 1492 C 语言实验题——大小写转换 水题 1493 C 语言实验题——圆柱体计算 水题 1494 C 语言实验题——温度转换 水题 1495 C 语言实验题——统计字串 水题1496 C 语言实验题——字符过滤 水题 1497 Coin Change 暴力求解 1498 Beautiful Meadow 搜索题 1499 C 语言实验题——鸡兔同笼 水题 1500 Coins of Luck 数学题:数学期望 1501 Friends 搜索:DFS 1502 Find All M^N Please 数学题 1503 Incredible Cows 搜索:二分+DFS 1504 计算直线的交点数 递推求解 1505 Number Game 动态规划 1506 Sort ZOJ7 字符串处理 1507 Find 7 Faster Than John Von Neumann 高精度计1508 免费馅饼 动态规划 1509 Worm 动态规划1510 Common Subsequence 动态规划 1511 搬寝室 动态规划 1512 Daydream 字符串处理 1513 Ballroom Lights 1514 Drop the Triples 1515 Finding Seats1516 He is offside! 1517 Justice League 1518 星星点点 搜索1519 逆波兰表达式 表达式求解:栈的应用 1520 十六进制 高精度计算 1521 Palindromic sequence 1522 Hotel 模拟题1523 Intersecting Lines 计算几何 1524 Heap Construction 最短路径 1525 Pizza Anyone? 1526 Adam's Genes 1527 Risk1528 Just the Facts 数论 1529 Horse Shoe Scoring 计算几何 1530 哥德巴赫猜想 数论1531 爱的伟大意义 简单题1532 校门外的树 模拟题 1533 最多约数问题 数论 1534 Quicksum 数学题1535 找规律填数字 数学题1536 Accepted Necklace 搜索:DFS1537 除法表达式 数论 1538 A Walk Through the Forest 图论:最短路径 1539 Accurately Say "CocaCola"! 简单题 1540 Build The Electric System 图论:最小生成树 1541 Colorful Rainbows 计算几何 1542 Easy Task 数学题1543 Faster, Higher, Stronger 简单题 1544 Give Me the Number 模拟题 1545 Hurdles of 110m 动态规划 1546 Just Pour the Water 矩阵计算 1547 Kinds of Fuwas 穷举法 1548 复数运算 简单题 1549 元素个数排序 简单题 1550 Fiber Communications 1551 Power Hungry Cows 搜索:BFS 1552 Cow Cycling 动态规划 1553 Rebuilding Roads 树型DP 1554 Triangular Pastures 动态规划 1555 Chores 动态规划 1556 Extra Krunch1557 BUY LOW, BUY LOWER 动态规划 1558 Hypnotic Milk Improvement 1559 Happy Cows1560 Unary Cow Counting 1561 Dairy Route 1562 Calf Numbers 1563 Hide and Seek 1564 Mountain Majesties 1565 Secret Milk Pipes 1566 Circus Tickets 1567 Life Cycle 1568 Wiggle Numbers 1569 Superwords 1570 Cow Brainiacs 1571 Pasture Fences 1572 New Years Party 1573 Strolling Cows 1574 Grazing Sets 1575 Factorial Power 1576 Friday the Thirteenth 1577 Beef McNuggets 1578 Calf Flac 1579 Light Bulbs 1580 Cow Math 图论1581 Cow Imposters 动态规划 1582 Traffic Lights 递推求解 1583 Farm Tour 图论:最短路径 1584 Vertical Histogram 简单题 1585 Cowties 动态规划 1586 Travel Games 搜索:DFS1587 Best Cow Fences 二分法 1588 Cornfields RMQ 问题 1589 Six Degrees of Cowvin Bacon 简单题 1590 Herd Sums 简单题1591 Message Decoding 简单题1592 Mountain Walking 二分+flood fill 1593 Millenium Leapcow 动态规划 1594 Optimal Milking 最大流+二分法1595 Bale Figures 模拟+二分法1596 Jumping Cows 动态规划 1597 Lost Cows SBT 树1598 Bovine Math Geniuses 简单题 1599 Dividing the Path 动态规划 1600 Fence Obstacle Course 动态规划 1601 Cow Ski Area 图论:flood fill 1602 Cleaning Shifts 贪心法 1603 Bad Cowtractors 最大生成树 1604 Tree Cutting 树状动态规划 1605 Navigation Nightmare 并查集 1606 Cow Marathon 树状动态规划 1607 Distance Queries LCA ,tarjan 算法 1608 Distance Statistics 楼天成大牛“男人八题”中的一道 1609 Moo University - Team Tryouts 排序+穷举法 1610 Moo University - Emergency Pizza Order 1611 Moo University - Financial Aid 最大堆、最小堆 1612 Cube Stacking 并查集 1613 The Cow Lineup 穷举法 1614 MooFest 线段树1615 Turning in Homework 动态规划 1616 Alignment of the Planets 1617 Finding Bovine Roots 1618 Cow Bowling1619 Cow Patterns 字符串匹配的扩展 1620 Barn Expansion 二分查找 1621 Layout 差分约束系统 1622 Knights of Ni 搜索:BFS 1623 Cleaning Shifts DP +Heap 1624 Scales 搜索+剪枝1625 Secret Milking Machine 二分+网络流 1626 Aggressive cows 二分法1627 Rigging the Bovine Election 穷举法 1628 Feed Accounting 简单模拟题1629 Muddy Fields 穷举法1630 The Wedding Juicer 堆+flood fill 1631 Naptime 动态规划 1632 Sumsets 动态规划1633 Moo Volume 简单题1634 Ombrophobic Bovines Floyd-Warshall 1635 Space Elevator 动态规划1636 Yogurt factory 动态规划 1637 Checking an Alibi 最短路径 1638 Out of Hay 1639 Satellite Photographs 搜索:BFS or DFS 1640 Asteroids 最大网络流 1641 Grazing on the Run 动态规划1642 Walk the Talk 动态规划1643 City Skyline 栈的应用 1644 Cow Acrobats 贪心法1645 Ant Counting 动态规划 1646 Hopscotch 搜索:DFS1647 Securing the Barn 穷举法 1648 Bovine Birthday 递推求解 1649 Max Factor 简单题 1650 Flying Right 1651 Close Encounter 1652 Allowance 1653 Lazy Cows 1654 Expedition 1655 Around the world 1656 Landscaping 1657 Waves1658 Navigating the City1659 Disease Management 1660 Muddy roads 1661 Wormholes 最短路径 1662 The Fewest Coins 动态规划 1663 Milk Patterns 二分法or 后缀树1664 Cow Picnic 搜索:BFS or DFS 1665 Cow Roller Coaster 动态规划 1666 River Hopscotch 二分法+贪心 1667 The Moronic Cowmpouter 进制转换 1668 DNA Assembly 穷举法1669 Cow Phrasebook 二分法 1670 Cellphones 穷举法1671 Steady Cow Assignment 网络流 1672 Treats for the Cows 动态规划 1673 Backward Digit Sums 穷举法 1674 Stump Removal 简单题 1675 Finicky Grazers 动态规划 1676 The Water Bowls 枚举二进制位 1677 Redundant Paths 图论 1678 Roping the Field 动态规划 1679 Corral the Cows 二分法 1680 The Cow Prom 图论 1681 Dollar Dayz 动态规划 1682 The Grove 最短路径 1683 Fence Repair Huffman 编码 1684 Corn Fields 状态压缩DP 1685 Roadblocks 图论:最短路径 1686 Bad Hair Day 搜索 1687 Big Square 穷举法 1688 Round Numbers 枚举二进制位 1689 Building A New Barn 1690 Cow Sorting 置换群 1691 Lilypad Pond 最短路径 1692 The Cow Lexicon 动态规划 1693 Silver Cow Party 最短路径 1694 Problem Solving 动态规划 1695 Cow School1696 Protecting the Flowers 贪心法 1697 Tallest Cow 区间统计 1698 Balanced Lineup RMQ 问题1699 Gold Balanced Lineup RMQ 问题 1700 Ranking the Cows 搜索:DFS 1701 Face The Right Way 穷举法 1702 Cow Traffic 动态规划 1703 Monthly Expense 贪心法 1704 Cheapest Palindrome 动态规划 1705 Dining 贪心+网络流 1706 City Horizon 离散化+ 扫描 1707 Catch That Cow 最短路径 1708 Fliptile 枚举+位压缩 1709 2-Dimensional Rubik's Cube 搜索:BFS 1710 Ball 计算几何1711 3D Camera 三维计算几何 1712 Cipher 模拟题1713 Five in a Row 简单题 1714 Pinhole Imaging 简单计算几何1715 URL 模拟题 1716 Battle of Submarines 集合DP 1717 WOJ 动态规划 1718 钥匙计数之二 递推求解 1719 BrokenLED 模拟题 1722 A+B again and again! 模拟题 1723 Just calculate it! 数论 1724 Guess how much I love you? 简单题 1725 NBA Finals 1726 Find Out an “E” 1727 Judging ACM/ICPC 1728 Cryptography of Alex 1729 Rings of square grid 1730 Fermat's Theorem 1731 Cup 二分法1732 Find the Path DP+二分法1733 Five in a Row, Again 动态规划 1734 Minimum Heap 递推求解1735 Name PK 模拟题 1736 Pendant 动态规划 1737 Radar 计算几何+搜索 1738 Ring 多串模式匹配 1739 Run 计算几何1740 Toxophily 简单题 1741 通讯录编排 简单题 1742 超缘分ACM 队伍 简单题1743 集合运算 简单题 1744 矩阵计算 简单题1745 Arbitrage 动态规划1746 The Tower of Babylon 动态规划 1747 Binomial Showdown 组合数学 1748 Dungeon Master 搜索:BFS1749 Equation Solver 表达式求值应用 1750 Frogger 最短路径 1751 Globetrotter 计算几何1752 Tree Recovery 数据结构:二叉树 1753 Artificial Intelligence? 1754 The Settlers of Catan 搜索 1755 France '98 概率问题1756 Goldbach's Conjecture 数论 1757 Heavy Cargo 最小生成树 1758 Quadtree1759 From Dusk till Dawn or: Vladimir the Vampir1760 Euro Cup 2000 1761 Quadtree II or: Florida Jones strikes back 1762 HTML 简单题1763 Paths on a Grid 组合数学:T 路问题 1764 Balanced Food 动态规划1765 California Jones and the Gate to Freedom 组1766 Diplomatic License 简单计算几何题 1767 Polygon Programming with Ease 数学题 1768 Hall of Fountains 搜索:BFS or DP1769 The Bottom of a Graph 图论:强连通分量 1770 Edge 1771 Fold1772 Largest Rectangle in a Histogram 动态规划 1773 Boolean Logic 1774 Code1775 In Danger 模拟题 1776 Fractran1777 Huffman's Greed 1778 Bullshit Bingo 字符串处理 1779 A Song contest 1780 Message1781 The skatepark's new ramps 1782 Road 1783 Warfare 1784 Blackjack 1785 Robintron1786 Diamond Dealer 计算几何:凸包 1787 Best Compression Ever 1788 Code Theft 1789 Dinner1790 Event Planning 1791 Getting Gold 1792 Introspective Caching1793 Just A Few More Triangles! 1794 Knights of the Round Table 图论:无向图的块1795 The Cow Doctor 穷举法1796 Wild West 线段树1797 Find the Clones 1798 The Warehouse1799 Widget Factory 数论:同余方程组1800 Martian Mining 动态规划 3301 字符串;AC 自动机, 动态规划;状态压缩3302 计算几何 3303 数学;代数运算;高斯消元 3304 图论;强连通分量;2-SAT 3305 动态规划;凸单调性优化 3306 枚举 3307 贪心3308 数学;代数运算 3309 最短路;佛洛伊德 3310 动态规划 3311 贪心3312 计数问题;递推,数状数组,二分查找 3313 数论;欧拉定理,快速幂取模 3314 计数问题,数状数组3315 博弈;Surreal 数;Farey 数列; 3316 计数问题;递推,高精度 3317 计数问题;容斥原理 3318 递推;矩阵乘法 3319 数学;概率 3320 背包 3321 动态规划3322 字符串;AC 自动机 3323 动态规划 3324 博弈 3325 搜索 3326 贪心 3327 最短路3328 数据结构(实现一种数据结构,支持要求的操作),数状数组 3329 图论;二分图最大权匹配 3330 数学;数论 3331 递推;矩阵乘法 3332 数学;数论,二分查找 3333 计算几何 3334 动态规划3335 字符串,后缀数组或拉宾卡普;动态规划 3336 数据结构;并查集 3337 计数问题,递推 3338 二分查找,贪心 3339 数学 3340 计算几何;凸包,图论;佛洛伊德;最小环 3341 动态规划 3342 广搜 3343 动态规划 3344 计算几何 3345 二分图最大匹配3346 树型DP 3347 动态规划 3348 数学;数论;进制 3349 计数问题 3350 贪心3351 数学;数论;进制 3352 动态规划,数论,组合数学 3353 数学;数论 3354 计数;递推 3355 图论;佛洛伊德3356 博弈 3357 动态规划 3358 数据结构;线段树,数状数组3359 计算几何,动态规划 3360 博弈;SG 函数 3361 图论;最近公共祖先 3362 图论;强连通分量;2-SAT 3363 计算几何3364 字符串;AC 自动机,动态规划 3365 搜索,舞蹈链 3366 数学;数论3367 数学;代数运算;高斯消元 3368 动态规划 3369 计数问题;递推 3370 网络流(错题) 3371 树型DP3372 数学;高精度 3373 数学; 3374 RMQ 3376 数学;进制 3377 字符串;后缀数组 3378 动态规划 3379 计算几何 3380 线段树3381 图论;欧拉路 3382 简单题3383 字符串;AC 自动机 3384 广搜 3385 计算几何,矩阵3386 语言处理3387 动态规划;状态压缩 3388 图论;全局最小割 3389 简单题 3390 广搜3391 数学;Pell 方程 3392 背包 3393 计算几何 3394 广搜3395 搜索;迭代加深 3396 数学;计数问题 3397 数学;解方程3398 分析 3399 模拟3400 数学;计数问题,数论。

ACM题目分类

ACM题目分类

-----------------------------最优化问题------------------------------------- ----------------------常规动态规划SOJ1162 I-KeyboardSOJ1685 ChopsticksSOJ1679 GangstersSOJ2096 Maximum SubmatrixSOJ2111 littleken bgSOJ2142 Cow ExhibitionSOJ2505 The County FairSOJ2818 QQ音速SOJ2469 Exploring PyramidsSOJ1833 Base NumbersSOJ2009 Zeros and OnesSOJ2032 The Lost HouseSOJ2113 数字游戏SOJ2289 A decorative fenceSOJ2494 ApplelandSOJ2440 The days in fzkSOJ2494 ApplelandSOJ2515 Ski LiftSOJ2718 BookshelfSOJ2722 Treats for the CowsSOJ2726 Deck of CardsSOJ2729 Space ElevatorSOJ2730 Lazy CowsSOJ2713 Cut the SequenceSOJ2768 BombSOJ2779 Find the max (I) (最大M子段和问题)SOJ2796 Letter DeletionSOJ2800 三角形SOJ2804 Longest Ordered Subsequence (II)SOJ2848 River Hopscotch(二分)SOJ2849 Cow Roller CoasterSOJ2886 Cow WalkSOJ2896 AlphacodeSOJ2939 bailey's troubleSOJ2994 RSISOJ3037 Painting the ballsSOJ3072 ComputersSOJ3078 windy's "K-Monotonic"SOJ3084 windy's cake IVSOJ3104 Game(注意大数运算,高精度)SOJ3110 k Cover of LineSOJ3111 k Median of LineSOJ3123 Telephone WireSOJ3142 Unfriendly Multi Permutation SOJ3213 PebblesSOJ3219 Cover UpSOJ3263 FunctionSOJ3264 Evil GameSOJ3339 graze2SOJ3341 SkiSOJ3352 The Baric BovineSOJ3503 Banana BoxesSOJ3633 Matches's GameSOJ3636 理想的正方形SOJ3711 Mountain RoadSOJ3723 Robotic Invasionnankai1134 Relation Orderingsrm150--div1--500----------------背包问题SOJ2222 Health PowerSOJ2749 The Fewest CoinsSOJ2785 Binary PartitionsSOJ2930 积木城堡SOJ3172 FishermanSOJ3300 Stockholm CoinsSOJ3360 Buying HaySOJ3531 Number Pyramids----------------状态DPSOJ2089 lykooSOJ2768 BombSOJ2819 AderSOJ2842 The TSP problemSOJ3025 Artillery(状态DP)SOJ3088 windy's cake VIIISOJ3183 Fgjlwj's boxesSOJ3259 Counting numbersSOJ3262 Square Fields(二分+状态DP) SOJ3371 Mixed Up CowsSOJ3631 Shopping Offers----------------树状DPSOJ 1870 Rebuilding RoadsSOJ 2136 Apple(树形依赖背包n*C算法)SOJ 2514 Milk Team SelectSOJ 2199 Apple TreeSOJ 3295 Treeland ExhibitionSOJ 3635 World Cup 2010hdoj1561 The more, The BetterPKU1655 Balancing ActPKU3107 GodfatherPKU3345 Bribing FIPAPKU2378 Tree CuttingPKU3140 Contestants DivisionPKU3659 Cell Phone Network---------------配合数据结构的优化DPSOJ 2702 AlannaSOJ 2978 TasksSOJ 3234 Finding SeatsSOJ 3540 股票交易-------------- 斜率优化SOJ 3710 特别行动队SOJ 3734 搬家SOJ 3736 Lawrence of Arabia---------------四边形不等式SOJ 1702 Cutting SticksSOJ 2775 Breaking Strings--------------- 最优化之排序(思考两个元素之间的先后关系,以此得出一个二元比较关系,并验证此关系可传递,反对称,进而排序)SOJ2509 The Milk QueueSOJ2547 cardsSOJ2850 Protecting the FlowersSOJ2957 Setting ProblemsSOJ3167 ComputerSOJ3331 Cards(2547加强版)SOJ3327 Dahema's Computer(通过此题学会排序)-----------------最优化之必要条件枚举(思考最优解所具有的性质,得出最优解的一个强必要条件,在此基础上枚举)SOJ3317 FGJ's PlaneSOJ3429 Food portion sizes--------------------------------贪心---------------------------------------SOJ1078 BlueEyes' ScheduleSOJ1203 Pass-MurailleSOJ1673 Gone FishingSOJ2574 pieSOJ2645 Buy One Get One FreeSOJ2701 In a CycleSOJ2876 Antimonotonicity(经典模型 O(n)算法)SOJ3343 Tower--------------------------------搜索--------------------------------------- SOJ1106 DWeepSOJ1626 squareSOJ2061 8 puzzleSOJ2485 SudokuSOJ1045 SticksSOJ2736 FliptileSOJ2771 Collecting StonesSOJ2715 Maze BreakSOJ2518 Magic Cow ShoesSOJ2829 binary strings(双向BFS)SOJ3005 Dropping the stonesSOJ3136 scu07t01的迷宫(BFS预处理然后枚举交汇点)SOJ3330 Windy's Matrix(BFS)--------------------------------DFA---------------------------------------- ---------------状态矩阵SOJ1826 Number SequenceSOJ1936 FirepersonsSOJ2552 Number of TilingsSOJ2919 Matrix Power Series (学习矩阵的快速乘法从此开始)SOJ2920 Magic BeanSOJ3021 Quad TilingSOJ3046 Odd Loving BakersSOJ3176 E-stringSOJ3246 Tiling a Grid With DominoesSOJ3323 K-Satisfied NumbersSOJ3337 Wqb's Word----------------DFA+DPSOJ1112 Repeatless Numbers(DFA+二分)SOJ2913 Number SubstringSOJ2826 Apocalypse SomedaySOJ3128 windy和水星 -- 水星数学家 1SOJ3182 Windy numbers---------------------------------图论-----------------------------------------------------------最短路SOJ1697 Cashier EmploymentSOJ2325 Word TransformationSOJ2427 Daizi's path systemSOJ2468 CatcusSOJ2751 Wormholes(SPFA判断负圈回路的存在性)SOJ2932 道路SOJ3160 Clear And Present DangerSOJ3335 Windy's Route(最短路径的分层图思想)SOJ3346 Best Spot(N^3放心的写)SOJ3423 Revamping Trails---------------------查分约束SOJ1687 Intervals---------------------最小生成树SOJ1169 NetworkingSOJ2198 HighwaysSOJ3366 Watering HoleSOJ3427 Dark roads---------------------强连通分支SOJ2832 Mars city---------------------2-SATSOJ3535 Colorful DecorationHDU3062 Party---------------------拓扑排序SOJ1075 BlueEyes and Apples (II)---------------------无向连通图上的割点和割边问题SOJ1935 ElectricityWHU145 Railway---------------------二分图的匹配------------------最大匹配SOJ1183 Girls and BoysSOJ1186 CoursesSOJ2035 The Tiling ProblemSOJ2077 Machine ScheduleSOJ2160 Optimal MilkingSOJ2342 Rectangles(Beloved Sons 模型)SOJ2472 Guardian of DecencySOJ2681 平方数 2SOJ2737 AsteroidsSOJ2764 Link-up GameSOJ2806 LED DisplaySOJ2958 Weird FenceSOJ3043 Minimum CostSOJ3038 Beloved Sons(简单贪心一下)SOJ3453 Stock ChartsZOJ3265 Strange Game---------------最佳匹配SOJ1981 Going HomeWHU1451 Special Fish---------------------最近公共祖先问题SOJ1187 Closest Common AncestorsSOJ1677 How far awaySOJ3023 NetworkSOJ3098 Bond---------------------其他SOJ3013 treeSOJ3056 Average distance(树上的DFS)---------------------------------网络流------------------------------------- ---------------------最大流POJ 1273 Drainage DitchesPOJ 1274 The Perfect Stall (二分图匹配)POJ 1698 Alice's ChancePOJ 1459 Power NetworkPOJ 2112 Optimal Milking (二分)POJ 2455 Secret Milking Machine (二分)POJ 3189 Steady Cow Assignment (枚举)POJ 1637 Sightseeing tour (混合图欧拉回路)POJ 3498 March of the Penguins (枚举汇点)POJ 1087 A Plug for UNIXPOJ 1149 Pigs (构图题)ZOJ 2760 How Many Shortest Path (边不相交最短路的条数)POJ 2391 Ombrophobic Bovines (必须拆点,否则有BUG)WHU 1124 Football Coach (构图题)SGU 326 Perspective (构图题,类似于 WHU 1124)UVa 563 CrimewaveUVa 820 Internet BandwidthPOJ 3281 Dining (构图题)POJ 3436 ACM Computer FactoryPOJ 2289 Jamie's Contact Groups (二分)SGU 438 The Glorious Karlutka River =) (按时间拆点)SGU 242 Student's Morning (输出一组解)SGU 185 Two shortest (Dijkstra 预处理,两次增广,必须用邻接阵实现,否则 MLE) HOJ 2816 Power LinePOJ 2699 The Maximum Number of Strong Kings (枚举+构图)ZOJ 2332 GemsJOJ 2453 Candy (构图题)SOJ 2414 Leapin' LizardsSOJ 2835 Pick Up PointsSOJ 3312 Stockholm KnightsSOJ 3353 Total Flow--------------------最小割SOJ2662 PlaygroundSOJ3106 Dual Core CPUSOJ3109 Space flightSOJ3107 SelectSOJ3185 Black and whiteSOJ3254 Rain and FgjSOJ3134 windy和水星 -- 水星交通HOJ 2634 How to earn moreZOJ 2071 Technology Trader (找割边)HNU 10940 CoconutsZOJ 2532 Internship (找关键割边)POJ 1815 Friendship (字典序最小的点割集)POJ 3204 Ikki's Story I - Road Reconstruction (找关键割边)POJ 3308 ParatroopersPOJ 3084 Panic RoomPOJ 3469 Dual Core CPUZOJ 2587 Unique Attack (最小割的唯一性判定)POJ 2125 Destroying The Graph (找割边)ZOJ 2539 Energy MinimizationZOJ 2930 The Worst ScheduleTJU 2944 Mussy Paper (最大权闭合子图)POJ 1966 Cable TV Network (无向图点连通度)HDU 1565 方格取数(1) (最大点权独立集)HDU 1569 方格取数(2) (最大点权独立集)HDU 3046 Pleasant sheep and big big wolfPOJ 2987 Firing (最大权闭合子图)SPOJ 839 Optimal Marks (将异或操作转化为对每一位求最小割)HOJ 2811 Earthquake Damage (最小点割集)2008 Beijing Regional Contest Problem A Destroying the bus stations ( BFS 预处理 )(http://acmicpc-live-archive.uva.es/nuevoportal/data/problem.php?p=4322)ZOJ 2676 Network Wars (参数搜索)POJ 3155 Hard Life (参数搜索)ZOJ 3241 Being a Hero-----------------有上下界ZOJ 2314 Reactor Cooling (无源汇可行流)POJ 2396 Budget (有源汇可行流)SGU 176 Flow Construction (有源汇最小流)ZOJ 3229 Shoot the Bullet (有源汇最大流)HDU 3157 Crazy Circuits (有源汇最小流)-----------------最小费用流HOJ 2715 Matrix3HOJ 2739 The Chinese Postman ProblemPOJ 2175 Evacuation Plan (消一次负圈)POJ 3422 Kaka's Matrix Travels (与 Matrix3 类似)POJ 2516 Minimum Cost (按物品种类多次建图)POJ 2195 Going HomePOJ 3762 The Bonus Salary!BUAA 1032 Destroying a PaintingPOJ 2400 Supervisor, Supervisee (输出所有最小权匹配)POJ 3680 IntervalsHOJ 2543 Stone IVPOJ 2135 Farm TourSOJ 3186 SegmentsSOJ 2927 终极情报网SOJ 3634 星际竞速HDU 3376 Matrix Again-----------------------------------数据结构--------------------------------- -----------------------------------基础数据结构----------------------栈SOJ2511 MooooSOJ3085 windy's cake V(经典栈与单调性的结合)SOJ3279 hm 与 zx 的故事系列2SOJ3329 Maximum Submatrix II(转化为上面两题的模型)---------------------双端队列SOJ2978 TasksSOJ3139 Sliding Window(双端队列最经典的应用)SOJ3636 理想的正方形-------------------- --------------高级数据结构---------------------线段树SOJ1862 Choice PearsSOJ2057 The manager's worrySOJ2249 Mayor's postersSOJ2309 In the Army NowSOJ2436 Picture puzzle gameSOJ2556 Find the PermutationSOJ2562 The End of CorruptionSOJ2719 Corral the Cows(线段树+二分)SOJ2740 Balanced LineupSOJ2745 零序列SOJ2776 Matrix SearchingSOJ2808 Thermal Death of the UniverseSOJ2822 Buy TicketsSOJ2937 TetrisSOJ2938 Apple Tree(先DFS获得欧拉序列)SOJ2965 capitally playersSOJ2968 Matrix(二维线段树)SOJ3019 Count ColorSOJ3022 Difference Is Beautiful( RMQ+二分经典模型)SOJ3086 windy's cake VI(二维线段树)SOJ3099 A Simple Problem with IntegersSOJ3248 MousetrapSOJ3321 Windy's Sequence IISOJ3370 Light SwitchingSOJ3640 Special Subsequence---------------------树状数组SOJ2309 In the Army Now---------------------归并排序思想SOJ2906 Ultra-QuickSortSOJ2431 Cows distribute food(利用归并排序求逆序数:nlogn) SOJ2497 Number sequenceSOJ2559 What is the Rank?SOJ2728 MooFestSOJ3009 Stones for AmySOJ3010 K-th NumberSOJ3147 K-th number---------------------并查集SOJ1824 The SuspectsSOJ1953 keySOJ2245 Ubiquitous ReligionsSOJ2389 Journey to TibetSOJ2438 PetSOJ2490 Math teacher's testPOJ2832 How many pairs?POJ2821 Auto-Calculation MachineSOJ2979 食物链SOJ3282 Kingdom of HeavenSOJ3417 Skyscrapers------------------------块状链表SOJ3032 Big StringSOJ3035 反转序列----------------------------------- 字符串---------------------后缀数组SOJ1948 sekretarkaSOJ3045 Long Long MessageSOJ3075 回文子串SOJ3296 Windy's S---------------------KMPSOJ2652 OulipoSOJ2307 String MatchingSOJ3014 Seek the Name, Seek the FameSOJ3596 Article Decryption--------------------trie树SOJ3076 相同字符串SOJ3336 DiarySOJ3596 Article Decryption---------------------------------组合数学及数论----------------------------- SOJ1839 Relatives(Euler函数)SOJ1942 FotoSOJ2714 Mountains (II)SOJ2668 C(n,k)SOJ2666 分解 n!SOJ2106 GCD & LCM InverseSOJ2498 Count primeSOJ2238 Let it Bead(置换群-polya定理的应用)SOJ2924 完美交换(置换群)SOJ2638 Cow Sorting(置换群)-------------费马小定理SOJ 3578 H1N1's Problem--------------------------容斥原理SOJ3191 Free squareSOJ3082 windy's cake IISOJ3502 The Almost Lucky NumbersSOJ3547 Coprime----------------------------------博弈论------------------------------------SOJ1128 控制棋SOJ1866 Games(诡异的博弈)SOJ2197 A Funny GameSOJ2188 A multiplication gameSOJ2403 Black and white chessSOJ2477 Simple GameSOJ2687 草稿纸 2SOJ2688 草稿纸 3SOJ2836 Pick Up Points IISOJ2845 JangeSOJ2922 A New Tetris GameSOJ2993 NimSOJ3066 JohnSOJ3132 windy和水星 -- 水星游戏 1SOJ3133 windy和水星 -- 水星游戏 2SOJ3174 Good gameSOJ3307 Stockholm GameSOJ3446 Nim or not NimSOJ3461 Nim-kSOJ3463 Ordered NimSOJ3468 Flip CoinsSOJ3548 gameSOJ3584 Baihacker and Oml-----------------------------------计算几何---------------------------------SOJ1138 WallSOJ1102 Picnic。

hdu题目整理

hdu题目整理

HDU题目整理【背包问题】2602 Bone Collector1114 Piggy-Bank1203 I NEED A OFFER!1171 Big Event in HDU1059 Dividing2844 Coins2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活2159 FATE1561 The more, The Better1011 Starship Troopers2639 Bone Collector II3033 I love sneakers!2955 Robberies2546 饭卡2415 Bribing FIPA1712 ACboy needs your help3535 AreYouBusy3449 Consumer【线段树+树状数组】2688 Rotate2838 Cow Sorting3015 Disharmony Trees3030 Increasing Speed Limits2227 Find the nondecreasing subsequences3450 Counting Sequences3465 Life is a Line1541 Stars2642 Stars1166 敌兵布阵3458 Rectangles Too!1542 Atlantis1828 Picture3016 Man Down1255 覆盖的面积2871 Memory Control1698 Just a Hook1394 Minimum Inversion Number1823 Luck and Love3397 Sequence operation2795 Billboard1540 Tunnel Warfare1779 9-Problem C1543 Paint the Wall3536 Painting【DP优化】2577 How to Type1513 Palindrome1025 Constructing Roads In JGShining's Kingdom3351 Seinfeld1978 How many ways2686 Matrix3376 Matrix Again3392 Pie1422 重温世界杯1505 City Game1506 Largest Rectangle in a Histogram2870 Largest Submatrix2830 Matrix Swapping II1024 Max Sum Plus Plus1244 Max Sum Plus Plus Plus1227 Fast Food1793 Minimal search cost2829 Lawrence3415 Max Sum of Max-K-sub-sequence3401 Trade3276 Star3045 Picnic Cows2993 MAX Average Problem/onlinejudge/showProblem.do?problemId=3756 有助理解"状态"的推荐题目,今年省赛金牌题Bridging signals /JudgeOnline/problem?id=1631 LIS优化Group /thx/problem.php?id=1351Group2 /thx/problem.php?id=1369 MiniCost /problem.php?pid=1880/JudgeOnline/problem?id=2823学习单调队列的推荐题目Fence /JudgeOnline/problem?id=1821单调队列Batch Scheduling /JudgeOnline/problem?id=1180 单调队列,优化斜率Post office /JudgeOnline/problem?id=1160四边形不等式优化/JudgeOnline/problem?id=3017单调队列优化/JudgeOnline/problem?id=3709单调队列,优化斜率【网络流】1532 Drainage Ditches1533 Going Home1853 Cyclic Tour3081 Marriage Match II3277 Marriage Match III3416 Marriage Match IV3315 My Brute3376 Matrix Again3313 Key Vertex3338 Kakuro Extension1565 方格取数(1)1569 方格取数(2)2686 Matrix3395 Special Fish2448 Mining Station on the Sea3035 War3046 Pleasant sheep and big big wolf3251 Being a Hero1733 Escape2883 kebab2732 Leapin' Lizards3061 Battle3157 Crazy Circuits/JudgeOnline/problem?id=3762/OnlineJudge/index.php/problem/read/id/1491/JudgeOnline/problem?id=2987/onlinejudge/showProblem.do?problemCode=2314/onlinejudge/showProblem.do?problemCode=1992Poj2914:/JudgeOnline/problem?id=2914(stoer-Wagner)/JudgeOnline/problem?id=3308SGU 176 http://acm.sgu.ru/problem.php?contest=0&problem=176容量有上下界的网络流问题,有难度/daizhy_acm/blog/item/c3e63252763ae66984352480.html 这里有个题目分类,有兴趣的话,可以去刷~/?p=217胡浩的博客上也有点东西~可以去看看~【字符匹配】1711 Number Sequence1867 A + B for you again3374 String Problem3336 Count the string1075 What Are You Talking About1251 统计难题1671 Phone List1247 Hat’s Words1800 Flying to the Mars2072 单词数2222 Keywords Search2896 病毒侵袭3065 病毒侵袭持续中2243 考研路茫茫——单词情结2825 Wireless Password2296 Ring3341 Lost's revenge3247 Resource Archiver【最短路】2544 最短路2066 一个人的旅行2112 HDU Today1874 畅通工程续1142 A Walk Through the Forest1385 Minimum Transport Cost1548 A strange lift1217 Arbitrage2680 Choose the best route2923 Einbahnstrasse2962 Trucking2722 Here We Go(relians) Again1690 Bus System2482 Transit search1596 find the safest road1598 find the most comfortable road2377 Bus Pass2363 Cycling2433 Travel1688 Sightseeing2833 WuKong3191 How Many Paths Are There【数据结构问题】http://124.205.79.250/JudgeOnline/problem?id=1456 Supermarkethttp://124.205.79.250/JudgeOnline/problem?id=3228 Gold Transportationhttp://124.205.79.250/JudgeOnline/problem?id=1182 食物链http://124.205.79.250/JudgeOnline/problem?id=1733 Parity gamehttp://124.205.79.250/JudgeOnline/problem?id=1417 True Liarshttp://124.205.79.250/JudgeOnline/problem?id=2912 Rochambeau/onlinejudge/showProblem.do?problemCode=3261 Connections in Galaxy Warhttp://124.205.79.250/JudgeOnline/problem?id=3264 Balanced Lineup(RMQ模板题)1829 A Bug's Life1272 小希的迷宫1325 Is It A Tree?1558 Segment set1598 find the most comfortable road 3461 Code Lock3367 Pseudoforest2473 Junk-Mail Filter3172 Virtual Friends3047 Zjnu Stadium3038 How Many Answers Are Wrong 2818 Building Block3234 Exclusive-OR2586 How far away ?2874 Connections between cities 3486 Interviewe2888 Check Corners【矩阵乘法】1575 Tr A1757 A Simple Math Problem2254 奥运2256 Problem of Precision1558 Gauss Fibonacci2604 Queuing2276 Kiki & Little Kiki 22855 Fibonacci Check-up2971 Tower2294 Pendant3117 Fibonacci Numbers2842 Chinese Rings3519 Lucky Coins Sequence3509 Buge's Fibonacci Number Problem 3524 Perfect Squares3483 A Very Simple Problem【搜索专题】1253 胜利大逃亡1072 Nightmare1495 非常可乐2757 Ocean Currents1026 Ignatius and the Princess I1728 逃离迷宫1401 Solitaire1175 连连看1016 Prime Ring Problem2809 God of War1043 Eight1667 The Rotation Game1547 Bubble Shooter2216 Game III2364 Escape2822 Dogs1983 Kaitou Kid - The Phantom Thief (2) 2821 Pusher2782 The Worm Turns2234 无题I1560 DNA sequence1813 Escape from Tetris2517 棋盘分割2416 Treasure of the Chimp Island 1226 超级密码2579 Dating with girls(2)。

acm大赛历年程序题

acm大赛历年程序题

acm大赛历年程序题ACM国际大学生程序设计竞赛(The ACM International Collegiate Programming Contest)是全球范围内最具声誉的大学生程序设计竞赛之一。

每年都有来自世界各地的顶尖大学参加这一比赛,他们将在规定的时间内解决一系列编程问题,以展示他们的算法和编程技巧。

历年来,ACM大赛的程序题目一直是各个大学的计算机科学学生学习和训练的重要素材。

ACM大赛历年程序题的设计旨在考察参赛者的算法设计与实现能力。

这些问题通常具有一定的难度,涵盖了多种算法和数据结构。

在ACM大赛中,选手需要在规定的时间内,根据给定的输入数据,编写程序解决问题,并输出正确的结果。

ACM大赛历年程序题通常分为多个分类,下面将列举几个常见的分类及其特点:1. 图论问题:图论是ACM大赛中常见的题目类型之一。

这类问题涉及到对图的建模和算法设计。

参赛者需要熟悉常见的图观念和算法,如图的遍历、最短路径、最小生成树等。

2. 动态规划问题:动态规划是ACM大赛中常用的解决问题的方法之一。

动态规划问题通常需要设计状态转移方程,并根据之前已经计算过的结果来推导最优解。

这类问题要求选手具备良好的逻辑思维和数学推导能力。

3. 贪心算法问题:贪心算法是一种简单而高效的算法思想。

贪心算法问题一般需要选手根据问题的特性,每次都选择当前情况下最优的解决方案。

这类问题在实际应用中非常常见,选手需要能够灵活地运用贪心策略解决问题。

4. 字符串处理问题:字符串处理问题涉及到对字符串进行各种操作,如匹配、查找、替换等。

选手需要熟练掌握字符串的各种操作和常见算法,如KMP算法、Boyer-Moore算法等。

5. 数学问题:数学问题在ACM大赛中也是常见的题目类型。

这类问题通常涉及到各种数学公式和算法,如排列组合、素数判定、快速幂等。

选手需要具备扎实的数学知识和计算能力。

ACM大赛历年程序题的学习对于计算机科学学生来说是非常重要的。

ACM字符串题目及源代码

ACM字符串题目及源代码

目录Hdu1403最长公共子串 (2)Pku1743不可以重复的最长重复子串 (3)Pku3261可以重叠k次的最长重复子串 (6)Spoj694不相同的子串的个数 (10)Hdu3068最长回文(扩展kmp) (12)Timus 1297 最长回文子串后缀数组解法 (15)Pku3693 重复次数最多的连续重复子串 (20)nlogn后缀数组TLE .............................................................................. 错误!未定义书签。

Kmp (21)SPOJ687重复次数最多的连续重复子串 (22)Pku3693同上题一样原理 (26)Pku3415 长度不小于k的公共子串的个数 (26)Hdu1403最长公共子串Sample InputbananacianaicSample Output3#include<iostream>#include<stdio.h>#include<string.h>using namespace std;#define maxn 200005int wa[maxn],wb[maxn],wv[maxn],wh[maxn];int cmp(int *r,int a,int b,int l){return r[a]==r[b]&&r[a+l]==r[b+l];} void da(char *r,int *sa,int n,int m){int i,j,p,*x=wa,*y=wb,*t;for(i=0;i<m;i++) wh[i]=0;for(i=0;i<n;i++) wh[x[i]=r[i]]++;for(i=1;i<m;i++) wh[i]+=wh[i-1];for(i=n-1;i>=0;i--) sa[--wh[x[i]]]=i;for(j=1,p=1;p<n;j*=2,m=p){if(j>n)break;for(p=0,i=n-j;i<n;i++) y[p++]=i;for(i=0;i<n;i++) if(sa[i]>=j) y[p++]=sa[i]-j;for(i=0;i<n;i++) wv[i]=x[y[i]];for(i=0;i<m;i++) wh[i]=0;for(i=0;i<n;i++) wh[wv[i]]++;for(i=1;i<m;i++) wh[i]+=wh[i-1];for(i=n-1;i>=0;i--) sa[--wh[wv[i]]]=y[i];for(t=x,x=y,y=t,p=1,x[sa[0]]=0,i=1;i<n;i++)x[sa[i]]=cmp(y,sa[i-1],sa[i],j)?p-1:p++;}return;}int rank[maxn],height[maxn];void calheight(char *r,int *sa,int n){int i,j,k=0;for(i=1;i<n;i++) rank[sa[i]]=i;for(i=0;i<n;height[rank[i++]]=k)for(k?k--:0,j=sa[rank[i]-1];r[i+k]==r[j+k];k++);return ;}int judge(int i,int n,int *sa){int t1,t2;if(sa[i]<=n)t1=1;else t1=0;if(sa[i-1]<=n)t2=1;else t2=0;if(t1!=t2)return 1;else return 0;}char r[maxn];char tmp[maxn];int sa[maxn];int main(){int i,j,n,m;//freopen("a.txt","r",stdin);while(scanf("%s%s",&r,&tmp)!=EOF){n=strlen(r);m=strlen(tmp);r[n]=' ';for(i=0,j=n+1;i<m;i++,j++)r[j]=tmp[i];n=n+m+1;///for(i=0;i<n;i++)printf("%c",r[i]);printf("\n");da(r,sa,n,'{');calheight(r,sa,n);int max=0;//for(i=0;i<n;i++)printf("%d",sa[i]);printf("\n");for(i=1;i<n;i++)if(height[i]>max&&judge(i,n-m-1,sa))max=height[i];printf("%d\n",max);}return 0;}Pku1743不可以重复的最长重复子串Time Limit: 1000MS Memory Limit: 30000K DescriptionA musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It is unfortunate but true that this representation of melodies ignores the notion of musical timing; but, this programming task is about notes and not timings.Many composers structure their music around a repeating &qout;theme&qout;, which, being a subsequence of an entire melody, is a sequence of integers in our representation. A subsequence of a melody is a theme if it:∙is at least five notes long∙appears (potentially transposed -- see below) again somewhere else in the piece of music ∙is disjoint from (i.e., non-overlapping with) at least one of its other appearance(s)Transposed means that a constant positive or negative value is added to every note value in the theme subsequence.Given a melody, compute the length (number of notes) of the longest theme.One second time limit for this problem's solutions!InputThe input contains several test cases. The first line of each test case contains the integer N. The following n integers represent the sequence of notes.The last test case is followed by one zero.OutputFor each test case, the output file should contain a single line with a single integer that represents the length of the longest theme. If there are no themes, output 0.Sample Input3025 27 30 34 39 45 52 60 69 79 69 60 52 45 39 34 30 26 22 1882 78 74 70 66 67 64 60 65 80Sample Output5#include<iostream>#include<stdio.h>#include<string.h>using namespace std;#define maxn 20010int wa[maxn],wb[maxn],wv[maxn],wh[maxn];int cmp(int *r,int a,int b,int l){return r[a]==r[b]&&r[a+l]==r[b+l];} void da(int *r,int *sa,int n,int m){int i,j,p,*x=wa,*y=wb,*t;for(i=0;i<m;i++) wh[i]=0;for(i=0;i<n;i++) wh[x[i]=r[i]]++;for(i=1;i<m;i++) wh[i]+=wh[i-1];for(i=n-1;i>=0;i--) sa[--wh[x[i]]]=i;for(j=1,p=1;p<n;j*=2,m=p){if(j>n)break;for(p=0,i=n-j;i<n;i++) y[p++]=i;for(i=0;i<n;i++) if(sa[i]>=j) y[p++]=sa[i]-j;for(i=0;i<n;i++) wv[i]=x[y[i]];for(i=0;i<m;i++) wh[i]=0;for(i=0;i<n;i++) wh[wv[i]]++;for(i=1;i<m;i++) wh[i]+=wh[i-1];for(i=n-1;i>=0;i--) sa[--wh[wv[i]]]=y[i];for(t=x,x=y,y=t,p=1,x[sa[0]]=0,i=1;i<n;i++)x[sa[i]]=cmp(y,sa[i-1],sa[i],j)?p-1:p++;}return;}int rank[maxn],height[maxn];void calheight(int *r,int *sa,int n){int i,j,k=0;for(i=1;i<n;i++) rank[sa[i]]=i;for(i=0;i<n;height[rank[i++]]=k)for(k?k--:0,j=sa[rank[i]-1];r[i+k]==r[j+k];k++);return ;}int r[maxn];int sa[maxn];bool Get(int k,int n){int i,mmin=sa[0],mmax=sa[0];for(i=1;i<n;i++){if(height[i]<k) mmin=sa[i],mmax=sa[i];else{mmin= min(mmin,sa[i]);mmax= max(mmax,sa[i]);if(mmax-mmin>=k) return 1;}}return 0;}int x[maxn];int main(){int i,n;//freopen("a.txt","r",stdin);while(scanf("%d",&n)&&n){for(i=0;i<n;i++)scanf("%d",&x[i]);if(n==1){printf("0\n");continue;}for(i=0;i<n-1;i++)r[i]=x[i+1]-x[i]+88;n--;da(r,sa,n,88+88);calheight(r,sa,n);int left=0,right=n/2;int ans=0;while(left<=right){int mid=(left+right)/2;if(mid>=0&&Get(mid,n)){ans=mid;left=mid+1;}else right=mid-1;}if(ans+1<5)printf("0\n");else printf("%d\n",ans+1);}return 0;}Pku3261可以重叠k次的最长重复子串Time Limit: 5000MS Memory Limit: 65536KTotal Submissions: 4486Accepted: 1904Case Time Limit: 2000MSDescriptionFarmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation, he discovered that although he can't predict the quality of milk from one day to the next, there are some regular patterns in the daily milk quality.To perform a rigorous study, he has invented a complex classification scheme by which each milk sample is recorded as an integer between 0 and 1,000,000 inclusive, and has recorded data from a single cow over N(1 ≤ N≤ 20,000) days. He wishes to find the longest pattern of samples which repeats identically at least K (2 ≤ K≤ N) times. This may include overlapping patterns -- 1 2 3 2 3 2 3 1 repeats 2 3 2 3 twice, for example.Help Farmer John by finding the longest repeating subsequence in the sequence of samples. It is guaranteed that at least one subsequence is repeated at least K times.InputLine 1: Two space-separated integers: N and KLines 2..N+1: N integers, one per line, the quality of the milk on day i appears on the i th line.OutputLine 1: One integer, the length of the longest pattern which occurs at least K timesSample Input8 212323231Sample Output4#include<iostream>#include<stdio.h>#include<string.h>using namespace std;#define maxn 1000010int wa[maxn],wb[maxn],wv[maxn],wh[maxn];int cmp(int *r,int a,int b,int l){return r[a]==r[b]&&r[a+l]==r[b+l];} void da(int *r,int *sa,int n,int m){int i,j,p,*x=wa,*y=wb,*t;for(i=0;i<m;i++) wh[i]=0;for(i=0;i<n;i++) wh[x[i]=r[i]]++;for(i=1;i<m;i++) wh[i]+=wh[i-1];for(i=n-1;i>=0;i--) sa[--wh[x[i]]]=i;for(j=1,p=1;p<n;j*=2,m=p){if(j>=n)break;for(p=0,i=n-j;i<n;i++) y[p++]=i;for(i=0;i<n;i++) if(sa[i]>=j) y[p++]=sa[i]-j;for(i=0;i<n;i++) wv[i]=x[y[i]];for(i=0;i<m;i++) wh[i]=0;for(i=0;i<n;i++) wh[wv[i]]++;for(i=1;i<m;i++) wh[i]+=wh[i-1];for(i=n-1;i>=0;i--) sa[--wh[wv[i]]]=y[i];for(t=x,x=y,y=t,p=1,x[sa[0]]=0,i=1;i<n;i++)x[sa[i]]=cmp(y,sa[i-1],sa[i],j)?p-1:p++;}return;}int r[maxn];int sa[maxn];int rank[maxn],height[maxn];void calheight(int *r,int *sa,int n){int i,j,k=0;for(i=0;i<n;i++) rank[sa[i]]=i;for(i=0;i<n;height[rank[i++]]=k)if(rank[i]-1>=0)for(k?k--:0,j=sa[rank[i]-1];r[i+k]==r[j+k]&&i+k<n&&j+k<n;k++);return ;}bool Get(int k,int n,int t){int i,num=1;for(i=1;i<n;i++){if(height[i]<k){num=1;}else{num++;if(num>=t)return 1;}}return 0;}int x[maxn];void ceshi(int n){int i;for(i=0;i<n;i++)printf("%d ",sa[i]);printf("\n");for(i=0;i<n;i++)printf("%d ",rank[i]);printf("\n");for(i=0;i<n;i++)printf("%d ",height[i]);printf("\n"); }int main(){int i,n,k;//freopen("a.txt","r",stdin);while(scanf("%d%d",&n,&k)!=EOF){for(i=0;i<n;i++)scanf("%d",&r[i]);da(r,sa,n,1000001);calheight(r,sa,n);//ceshi(n);int left=0,right=n;int ans=0;while(left<=right){int mid=(left+right)/2;if(mid>=0&&Get(mid,n,k)){ans=mid;left=mid+1;}else right=mid-1;}printf("%d\n",ans);}return 0;}Spoj694不相同的子串的个数Given a string, we need to find the total number of its distinct substrings.InputT- number of test cases. T<=20;Each test case consists of one string, whose length is <= 1000OutputFor each test case output one number saying the number of distinct substrings.ExampleSample Input:2CCCCCABABASample Output:59Explanation for the testcase with string ABABA:len=1 : A,Blen=2 : AB,BAlen=3 : ABA,BABlen=4 : ABAB,BABAlen=5 : ABABAThus, total number of distinct substrings is 9.#include<iostream>#include<stdio.h>#include<string.h>using namespace std;#define maxn 1000010int wa[maxn],wb[maxn],wv[maxn],wh[maxn];int cmp(int *r,int a,int b,int j,int n){int x=r[a+j];int y=r[b+j];if(a+j>=n)x=-1;if(b+j>=n)y=-1;return r[a]==r[b]&&x==y;}void da(int *r,int *sa,int n,int m){int i,j,p,*x=wa,*y=wb,*t;for(i=0;i<m;i++) wh[i]=0;for(i=0;i<n;i++) wh[x[i]=r[i]]++;for(i=1;i<m;i++) wh[i]+=wh[i-1];for(i=n-1;i>=0;i--) sa[--wh[x[i]]]=i;for(j=1,p=1;p<n;j*=2,m=p){// printf("X:");// for(i=0;i<n;i++)printf("%d ",x[i]);printf("\n");if(j>=n)break;for(p=0,i=n-j;i<n;i++) y[p++]=i;for(i=0;i<n;i++) if(sa[i]>=j) y[p++]=sa[i]-j;// printf("Y:");// for(i=0;i<n;i++)printf("%d ",y[i]);printf("\n");for(i=0;i<n;i++) wv[i]=x[y[i]];for(i=0;i<m;i++) wh[i]=0;for(i=0;i<n;i++) wh[wv[i]]++;for(i=1;i<m;i++) wh[i]+=wh[i-1];for(i=n-1;i>=0;i--) sa[--wh[wv[i]]]=y[i];// printf("sa:");// for(i=0;i<n;i++)printf("%d ",sa[i]);printf("\n\n");for(t=x,x=y,y=t,p=1,x[sa[0]]=0,i=1;i<n;i++)x[sa[i]]=cmp(y,sa[i-1],sa[i],j,n)?p-1:p++;}// printf("X:");// for(i=0;i<n;i++)printf("%d ",x[i]);printf("\n");return;}int r[maxn],sa[maxn],rank[maxn],height[maxn];void calheight(int *r,int *sa,int n){int i,j,k=0;for(i=0;i<n;i++) rank[sa[i]]=i;for(i=0;i<n;height[rank[i++]]=k)if(rank[i]-1>=0)for(k?k--:0,j=sa[rank[i]-1];r[i+k]==r[j+k]&&i+k<n&&j+k<n;k++);return ;}int Get(int n,int *sa){int i,ans=n-sa[0];for(i=1;i<n;i++){ans+=n-sa[i]-height[i];}return ans;}void ceshi(int n){int i;//for(i=0;i<n;i++)printf("%d ",r[i]);printf("\n");for(i=0;i<n;i++)printf("%d ",sa[i]);printf("\n");// for(i=0;i<n;i++)printf("%d ",rank[i]);printf("\n");for(i=1;i<n;i++)printf("%d ",height[i]);printf("\n");}char s[maxn];int main(){int i,n,k,T;scanf("%d",&T);while(T--){scanf("%s",&s);n=strlen(s);for(i=0;i<n;i++)r[i]=s[i]-'A'+1;da(r,sa,n,130);calheight(r,sa,n);// ceshi(n);printf("%d\n",Get(n,sa));}return 0;}Hdu3068最长回文(扩展kmp)Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K(Java/Others)Problem Description给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等Input输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c...y,z组成的字符串S 两组case之间由空行隔开(该空行不用处理)字符串长度len <= 110000Output每一行一个整数x,对应一组case,表示该组case的字符串中所包含的最长回文长度.Sample InputaaaaababSample Output43//扩展kmp#include <iostream>using namespace std;#define Max 110005#define inf 10000000char a[Max];//主串char b[Max];//模式串int nextb[Max],nexta1[Max],nexta2[Max],ans;void kmp1(char*b,int*nextb){int i,j,k,t;i=0;while(b[i]==b[i+1])i++;nextb[1]=i;k=1;for(i=2;b[i];i++){if(nextb[i-k]+i<nextb[k]+k)nextb[i]=nextb[i-k];else{j=nextb[k]+k-i;if(j<0)j=0;while(b[j]==b[j+i]&&b[i+j])j++;nextb[i]=j;k=i;}}}void kmp2(char*a,char*b,int*nexta,int*nextb,int len) {kmp1(b,nextb);int i,j,k;i=0;while(a[i]==b[i])i++;nexta[0]=i;k=0;for(i=1;i<len;i++){if(nextb[i-k]+i<nexta[k]+k)nexta[i]=nextb[i-k];else{j=nexta[k]+k-i;if(j<0)j=0;while(b[j]==a[j+i]&&b[j]&&j+i<len)j++;nexta[i]=j;k=i;}}}void rev(char*a,int len){char t;for(int i=0;i<len/2;i++)t=a[i],a[i]=a[len-1-i],a[len-1-i]=t; }void solve(char*a,int len){if(len<=ans||len<2)return;int mid=len>>1;int i;for(i=mid;i<len;i++) b[i-mid]=a[i];b[i-mid]=0;rev(a,len);kmp2(a,b,nexta1,nextb,len);rev(a,len);for(i=0;i<mid;i++) b[i]=a[mid-i-1];b[i]=0;kmp2(a,b,nexta2,nextb,len);nexta1[len]=nexta2[len]=0;for(i=0;i<mid;i++){if(nexta2[i]>=(mid-i)/2){int x=mid-i+2*nexta1[len-i];if(x>ans)ans=x;}}for(i=mid;i<len;i++){if(nexta1[len-i]>=(i-mid)/2){int x=i-mid+2*nexta2[i];if(x>ans)ans=x;}}solve(a, mid-1);solve(a + mid, len-mid);}int main(){//freopen("a.txt","r",stdin);while(scanf("%s",a)!=EOF){ans=1;solve(a,strlen(a));printf("%d\n",ans);}}Timus 1297 最长回文子串后缀数组解法Time Limit: 1.0 secondMemory Limit: 16 MBThe “U.S. Robots” HQ has just received a rather alarming anonymous letter. It states that the agent from the competing «Robots Unlimited» has infiltrated into “U.S. Robotics”. «U.S. Robots» security service would have already started an undercover operation to establish the agent’s identity, but, fortunately, the letter describes communication channel the agent uses. He will publish articles containing stolen data to the “Solaris” almanac. Obviously, he will obfuscate the data, so “Robots Unlimited” will have to use a special descrambler (“Robots Unlimited” partnumber NPRx8086, specifications are kept secret).Having read the letter, the “U.S. Robots” president recalled having hired the “Robots Unlimited” ex-employee John Pupkin. President knows he can trust John, because John is still angry at being mistreated by “Robots Unlimited”. Unfortunately, he was fired just before his team has finished work on the NPRx8086 design.So, the president has assigned the task of agent’s message interception to John. At first, John felt rather embarrassed, because revealing the hidden message isn’t any easier than finding a needle in a haystack. However, after he struggled the problem for a while, he remembered that the design of NPRx8086 was still incomplete. “Robots Unlimited” fired John when he was working on a specific module, the text direction detector. Nobody else could finish that module, so the descrambler will choose the text scanning direction at random. To ensure the correct descrambling of the message by NPRx8086, agent must encode the information in such a way that the resulting secret message reads the same both forwards and backwards.In addition, it is reasonable to assume that the agent will be sending a very long message, so John has simply to find the longest message satisfying the mentioned property.Your task is to help John Pupkin by writing a program to find the secret message in the text of a given article. As NPRx8086 ignores white spaces and punctuation marks, John will remove them from the text before feeding it into the program.InputThe input consists of a single line, which contains a string of Latin alphabet letters (no other characters will appear in the string). String length will not exceed 1000 characters.OutputThe longest substring with mentioned property. If there are several such strings you should output the first of them.Sampleinput ThesampletextthatcouldbereadedthesameinbothordersArozaupalanalapuazorAoutputArozaupalanalapuazorA#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;#define maxn 110010*2int wa[maxn],wb[maxn],wv[maxn],wh[maxn];int cmp(int *r,int a,int b,int j,int n){int x=r[a+j];int y=r[b+j];if(a+j>=n)x=-1;if(b+j>=n)y=-1;return r[a]==r[b]&&x==y;}void da(int *r,int *sa,int n,int m){int i,j,p,*x=wa,*y=wb,*t;for(i=0;i<m;i++) wh[i]=0;for(i=0;i<n;i++) wh[x[i]=r[i]]++;for(i=1;i<m;i++) wh[i]+=wh[i-1];for(i=n-1;i>=0;i--) sa[--wh[x[i]]]=i;for(j=1,p=1;p<n;j*=2,m=p){if(j>=n)break;for(p=0,i=n-j;i<n;i++) y[p++]=i;for(i=0;i<n;i++) if(sa[i]>=j) y[p++]=sa[i]-j;for(i=0;i<n;i++) wv[i]=x[y[i]];for(i=0;i<m;i++) wh[i]=0;for(i=0;i<n;i++) wh[wv[i]]++;for(i=1;i<m;i++) wh[i]+=wh[i-1];for(i=n-1;i>=0;i--) sa[--wh[wv[i]]]=y[i];for(t=x,x=y,y=t,p=1,x[sa[0]]=0,i=1;i<n;i++)x[sa[i]]=cmp(y,sa[i-1],sa[i],j,n)?p-1:p++;}return;}int r[maxn],sa[maxn],Rank[maxn],height[maxn];void calheight(int *r,int *sa,int n){int i,j,k=0;for(i=0;i<n;i++) Rank[sa[i]]=i;for(i=0;i<n;height[Rank[i++]]=k)if(Rank[i]-1>=0)for(k?k--:0,j=sa[Rank[i]-1];r[i+k]==r[j+k]&&i+k<n&&j+k<n;k++);return ;}int Get(int n,int *sa){int i,ans=n-sa[0];for(i=1;i<n;i++){ans+=n-sa[i]-height[i];}return ans;}void ceshi(int n){int i;// for(i=0;i<n;i++)printf("%d ",sa[i]);printf("\n");for(i=1;i<n;i++)printf("%d ",i);printf("\n");// for(i=0;i<n;i++)printf("%d ",r[i]);printf("\n");// for(i=0;i<n;i++)printf("%d ",sa[i]);printf("\n");// for(i=0;i<n;i++)printf("%d ",rank[i]);printf("\n");for(i=1;i<n;i++)printf("%d ",height[i]);printf("\n");}char s[maxn];struct Node{int left,right;int min;}node[maxn*3];void build(int n,int left,int right){node[n].left=left;node[n].right=right;if(left==right){node[n].min=height[left];return ;}int mid=(left+right)/2;build(n*2,left,mid);build(n*2+1,mid+1,right);if(node[n*2].min>node[n*2+1].min)node[n].min=node[n*2+1].min;else node[n].min=node[n*2].min;}int qur(int n,int left,int right){int mid=(node[n].right+node[n].left)/2;if(node[n].left==node[n].right)return node[n].min;if(node[n*2].right>=right)return qur(n*2,left,right);else if(node[n*2+1].left<=left)return qur(n*2+1,left,right);else return min(qur(n*2,left,mid),qur(n*2+1,mid+1,right));}int main(){int i,n,j;while(scanf("%s",&s)!=EOF){n=strlen(s);for(i=0;i<n;i++)r[i]=s[i]-'A'+1;r[n]=59;for(i=n+1,j=n-1;i<2*n+1;j--,i++)r[i]=s[j]-'A'+1;da(r,sa,n*2+1,60);calheight(r,sa,n*2+1);build(1,1,n*2);//for(i=1;i<=15;i++)printf("%d ",node[i].min);printf("\n");//ceshi(n*2+1);int Max=0;//回文为奇数int first=0;for(i=0;i<n;i++){int x=Rank[i];int y=Rank[2*n-i];if(x>y)swap(x,y);int t=qur(1,x+1,y);t=t*2-1;if(t>Max){Max=t;first=i-(t)/2;}}//回文为偶数for(i=0;i<n;i++){int x=Rank[2*n-i];int y=Rank[i+1];if(x>y)swap(x,y);int t=qur(1,x+1,y);t=t*2;if(t>Max){Max=t;first=i-t/2+1;}}// printf("%d\n",Max);for(i=first;i<first+Max;i++)printf("%c",s[i]);printf("\n");//int left,right;//while(cin>>left>>right)cout<<qur(1,left,right)<<endl; }return 0;}Pku3693 重复次数最多的连续重复子串Time Limit: 1000MS Memory Limit: 65536KDescriptionThe repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For example, the repetition number of "ababab" is 3 and "ababa" is 1.Given a string containing lowercase letters, you are to find a substring of it with maximum repetition number.InputThe input consists of multiple test cases. Each test case contains exactly one line, whichgives a non-empty string consisting of lowercase letters. The length of the string will not be greater than 100,000.The last test case is followed by a line containing a '#'.OutputFor each test case, print a line containing the test case number( beginning with 1) followed by the substring of maximum repetition number. If there are multiple substrings of maximum repetition number, print the lexicographically smallest one.Sample Inputccabababcdaabbccaa#Sample OutputCase 1: abababCase 2: aaPku2406 Power StringsTime Limit:3000MS Memory Limit:65536KTotal Submissions:15626 Accepted:6580DescriptionGiven two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b= "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponentiation by a non-negative integer is defined in the normal way: a^0 = "" (the empty string) and a^(n+1) = a*(a^n).InputEach test case is a line of input representing s, a string of printable characters. The length of s will be at least 1 and will not exceed 1 million characters. A line containing a period follows the last test case.OutputFor each s you should print the largest n such that s = a^n for some string a.Sample Inputabcdaaaaababab.Sample Output143Kmp#include<iostream>#include<cstdio>#include<cstring>using namespace std;#define maxn 1000010char s[maxn];int next[maxn],len;void GetNext(int n){next[0]=-1;int i=0,j=-1;while(i<n){if(j==-1||s[i]==s[j]){i++;j++;next[i]=j;}else j=next[j];}}int main(){int i,j,n;//freopen("a.txt","r",stdin);while(scanf("%s",s)!=EOF){n=strlen(s);if(n==1&&s[0]=='.')break;GetNext(n);//for(i=0;i<=n;i++)printf("%d ",next[i]);printf("\n");if(n%(n-next[n])==0){printf("%d\n",n/(n-next[n]));}else printf("1\n");}return 0;}SPOJ687重复次数最多的连续重复子串A string s is called an (k,l)-repeat if s is obtained by concatenating k>=1 times some seed string t with length l>=1. For example, the strings = abaabaabaabais a (4,3)-repeat with t = aba as its seed string. That is, the seed string t is 3 characters long, and the whole string s is obtained by repeating t 4 times.Write a program for the following task: Your program is given a long string u consisting of characters ‘a’ and/or ‘b’ as input. Your program must find some (k,l)-repeat that occurs as substring within u with k as large as possible. For example, the input stringu = babbabaabaabaababcontains the underlined (4,3)-repeat s starting at position 5. Since u contains no other contiguous substring with more than 4 repeats, your program must output the maximum k.InputIn the first line of the input contains H- the number of test cases (H <= 20). H test cases follow. First line of each test cases is n - length of the input string (n <= 50000), The next n lines contain the input string, one character (either ‘a’ or ‘b’) per line, in o rder.OutputFor each test cases, you should write exactly one interger k in a line - the repeat count that is maximized.ExampleInput:117babbabaabaabaababOutput:4#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>using namespace std;#define maxn 110010*2int wa[maxn],wb[maxn],wv[maxn],wh[maxn];int cmp(int *r,int a,int b,int j,int n){int x=r[a+j];int y=r[b+j];if(a+j>=n)x=-1;if(b+j>=n)y=-1;return r[a]==r[b]&&x==y;}void da(int *r,int *sa,int n,int m){int i,j,p,*x=wa,*y=wb,*t;for(i=0; i<m; i++) wh[i]=0;for(i=0; i<n; i++) wh[x[i]=r[i]]++;for(i=1; i<m; i++) wh[i]+=wh[i-1];for(i=n-1; i>=0; i--) sa[--wh[x[i]]]=i;for(j=1,p=1; p<n; j*=2,m=p){if(j>=n)break;for(p=0,i=n-j; i<n; i++) y[p++]=i;for(i=0; i<n; i++) if(sa[i]>=j) y[p++]=sa[i]-j;for(i=0; i<n; i++) wv[i]=x[y[i]];for(i=0; i<m; i++) wh[i]=0;for(i=0; i<n; i++) wh[wv[i]]++;for(i=1; i<m; i++) wh[i]+=wh[i-1];for(i=n-1; i>=0; i--) sa[--wh[wv[i]]]=y[i];for(t=x,x=y,y=t,p=1,x[sa[0]]=0,i=1; i<n; i++)x[sa[i]]=cmp(y,sa[i-1],sa[i],j,n)?p-1:p++;}return;}int r[maxn],sa[maxn],Rank[maxn],height[maxn];void calheight(int *r,int *sa,int n){int i,j,k=0;for(i=0; i<n; i++) Rank[sa[i]]=i;for(i=0; i<n; height[Rank[i++]]=k)if(Rank[i]-1>=0)for(k?k--:0,j=sa[Rank[i]-1]; r[i+k]==r[j+k]&&i+k<n&&j+k<n; k++);return ;}int Get(int n,int *sa){int i,ans=n-sa[0];for(i=1; i<n; i++){ans+=n-sa[i]-height[i];}return ans;}int RMQ[maxn];int mm[maxn];int best[20][maxn];void initRMQ(int n){int i,j,a,b;for(mm[0]=-1,i=1; i<=n; i++)mm[i]=((i&(i-1))==0)?mm[i-1]+1:mm[i-1];for(i=1; i<=n; i++) best[0][i]=i;for(i=1; i<=mm[n]; i++)for(j=1; j<=n+1-(1<<i); j++){a=best[i-1][j];b=best[i-1][j+(1<<(i-1))];if(RMQ[a]<RMQ[b]) best[i][j]=a;else best[i][j]=b;}return;}int askRMQ(int a,int b){int t;t=mm[b-a+1];b-=(1<<t)-1;a=best[t][a];b=best[t][b];return RMQ[a]<RMQ[b]?a:b;}int lcp(int a,int b){int t;a=Rank[a];b=Rank[b];if(a>b){t=a;a=b;b=t;}return(height[askRMQ(a+1,b)]);}char c;int main(){int i,j,jj,k,n,now,ans,nn;。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

1001 这个就不用说了吧1002 简单的大数1003 DP经典问题,最大连续子段和1004 简单题1005 找规律(循环点)1006 感觉有点BT的题,我到现在还没过1007 经典问题,最近点对问题,用分治1008 简单题1009 贪心1010 搜索题,剪枝很关键10111012 简单题1013 简单题(有个小陷阱)1014 简单题1015 可以看作搜索题吧1016 经典的搜索1017 简单数学题1018 简单数学题1019 简单数学题1020 简单的字符串处理1021 找规律的数学题1022 数据结构的题(栈的应用)1023 特殊的数(Catalan Number)1024 经典DP,最大M子段和1025 经典DP,最长递增子序列(要用NLogN的方法过)1026 搜索1027 数学题(或用STL)1028 经典问题,整数拆分,用母函数做1029 简单题(一般方法容易超时)1030 简单题,可用模拟过1031 简单题1032 简单题1033 模拟题1034 Candy Sharing Game1035 模拟题1036 简单题1037 简单题,不是一般的简单1038 简单题1039 字符串处理1040 简单题,排序1041 简单题,用大数1042 大数1043 经典搜索题,八数码问题1044 稍微有点麻烦的搜索题1045 搜索题,可用匹配做1046 简单题1047 简单的大数1048 简单字符串处理1049 简单题1050 贪心1051 经典贪心,也可以用DP1052 贪心1053 贪心,关于Huffman编码1054 二分匹配1055 二分匹配1056 简单题1057 模拟题1058 经典问题,丑数,DP1059 经典问题,可以用母函数或DP(不针对题目优化都会超时)1060 数学题1061 数学题1062 简单字符串处理1063 模拟大数1064 简单题1065 简单题1066 数学题,找规律10671068 经典二分匹配1069 经典DP1070 简单题1071 简单数学题1072 搜索1073 字符串处理1074 DP1075 字典树1076 简单题10771078 DP1079 博弈(DP)1080 DP1081 经典DP1082 简单题1083 二分匹配1084 简单题1085 母函数1086 简单几何题1087 简单DP1088 字符串处理1089~1096 (练习输入输出的8个题目)1097 简单数学题1098 数学题,注意找规律1099 数学题模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 1049 1050 1057 1062 1063 1064 1070 1073 1075 1082 1083 1084 1088 1106 1107 1113 1117 1119 1128 1129 1144 1148 1157 1161 1170 1172 1177 1197 1200 1201 1202 1205 1209 1212(大数取模) 1216(链表)1218 1219 1225 1228 1229 1230 1234 1235 1236 1237 1239 1250 1256 1259 1262 1263 1265 1266 1276 1279 1282 1283 1287 1296 1302 1303 1304 1305 1306 1309 1311 1314复杂模拟搜索,递归求解1010 1016 1026 1043(双广) 1044 (BFS+DFS) 1045 1067 1072 1104 1175 1180 1195 1208 1226 1238 1240 1241 1242 1258 1271 1312 1317博奕1079动态规划1003 1024 1025 1028 1051 1058 1059 1069 1074 1078 1080 1081 1085 1087 1114 1158 1159 1160 1171 1176 1181 1203 1224 1227 1231 1244 1248 1253 1254 1283 1300数学,递推,规律1005 1006 1012 1014 1018 1019 1021 1023 1027 1030 1032 1038 1041 1046 1059 1060 1061 1065 1066 1071(微积分) 1097 1098 1099 1100 1108 1110 1112 1124 1130 1131 1132 1134 1141 1143 1152 1155(物理题) 1163 1165 1178 1194 1196(lowbit) 1210 1214 1200 1221 1223 1249 1261 1267 1273 1290 1291 1292 1294 1297 1313 1316数论1164 1211 1215 1222 1286 1299计算几何1086 1115 1147贪心1009 1052 1055 1257并查集1198 1213 1232 1272线段树,离散化1199 1255图论最短路相关的问题1142 1162 1217 1301二分图问题1054 1068 1150 1151 1281其他1053 (huffman) 1102(MST) 1116(欧拉回路)1233(MST) 1269(强连通)数据结构1103(堆+模拟)1166(数状树组)1247 1251 1285(Topol)12981207最近顶点对10071500 DP1501 DP1502 DP or 记忆化1503 DP1504 模拟1505 DP1506 DP1507 2分匹配1508 记忆化容易点1509 模拟1510 DP1511 搜索可以过1512 左偏树1513 DP1514 DP1515 DFS1516 DP1517 博奕1518 搜索1519 DP(不确定)1520 树状DP1521 数学题,母函数什么的。

其实都可以过1522 稳定婚姻1523 DP1524 博弈1525 博弈1526 Maxflow1527 博弈1528 2分匹配1529 简单题1530 最大团1531 差分约束1532 Maxflow 入门题1533 KM Or 最小费用流1534 差分约束1535 差分约束1536 博弈1537 模拟加置换群的理论CODE可以短些,其实没必要。

1538 很有意思的题目。

据说是Microsoft亚洲总裁面试的题目1539 搜索1541 树状数组1542 离散,线段树1543 线段树1544 简单的1545 DP /forum/htm_data/18/0608/2050.html 1546 搜索1547 模拟1548 模拟1551 2分答案155315541555 简单1556 技巧。

数学1557 搜索1558 并查+ 线段判交1559 DP1560 减支+ 搜索1561 树状DP1562 暴力between 1000 and 99991563 简单1564 博弈。

1565 状态DP1566 数学1567 模拟1568 大数1569 最小割1570 数学1571 最段路1572 搜索1573 数学1574 DP1575 2分1576 数论1577 模拟,处理精度1579 记忆化1580 DP1582 搜索1583 模拟1584 搜索158515861587 简单题目1591 模拟1592 简单1593 数学1594 数学1595 图论1596 图论1597 图论1598 图论1599 图论List of solved problems1000 1/8 1001 1/4 1002 1/10 1003 1/1 1004 1/3 1008 1/8 1012 1/2 1013 1/1 1014 1/3 1017 1/3 1018 1/5 1021 1/1 1032 1/2 1037 1/1 1040 1/6 1048 1/2 1049 1/1 1056 1/3 1058 1/5 1061 1/1 1062 1/2 1064 1/1 1065 1/3 1070 1/11 1076 1/2 1088 1/1 1089 1/1 1090 1/1 1091 1/1 1092 1/4 1093 1/1 1094 1/1 1095 1/2 1096 1/3 1097 1/3 1106 1/6 1108 1/3 1124 1/1 1128 1/2 1157 1/1 1161 1/1 1164 1/3 1170 1/1 1194 1/3 1196 1/1 1200 1/1 1201 1/4 1202 1/3 1212 1/1 1219 1/1 1229 1/2 1234 1/1 1235 1/1 1236 1/1 1251 1/2 1259 1/1 1262 1/1 1266 1/1 1279 1/10 1282 1/1 1303 1/1 1321 1/1 1323 1/2 1328 1/2 1339 1/1 1379 1/5 1390 1/1 1395 1/8 1406 1/4 1407 1/5 1412 1/2 1491 1/2 1556 2/5 1570 1/2 1587 1/1 1673 1/1 1720 1/2 2000 1/2 2001 1/1 2002 1/3 2003 1/3 2004 1/1 2005 1/1 2006 1/1 2007 1/6 2008 1/2 2009 1/1 2010 2/7 2011 1/1 2012 1/1 2013 1/1 2014 1/1 2015 1/1 2016 1/1 2017 1/3 2019 1/3 2020 1/1 2021 1/1 2022 1/4 2023 1/3 2024 1/5 2025 2/3 2026 1/1 2027 1/8 2029 1/1 2030 1/4 2032 1/2 2033 1/1 2034 1/2 2035 1/1 2039 1/2 2040 1/1 2042 1/1 2043 1/2 2051 1/1 2052 1/2 2054 1/4 2055 1/1 2070 1/2 2071 1/1 2075 1/1 2081 1/1 2084 1/4 2087 1/1 2089 1/5 2090 2/8 2092 1/1 2096 1/1 2098 1/1 2099 1/1 2101 1/1 2107 1/1 2113 1/4 2123 2/5 2132 1/7 2139 1/2 2148 1/2 2153 1/1 2162 1/1 2186 1/1 2368 1/3 2500 1/1 2700 1/2 2816 1/8。

相关文档
最新文档