HDU - 3746 kmp求循环节 Cyclic NacklaceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12136 Accepted Submission(s): 5124Problem DescriptionCC always becomes very de...
kmp统计最多出现几个模式串 剪花布条Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 25817 Accepted Submission(s): 15844Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。...
初学Python和pygame写小游戏 alien.py:外星人的类,负责外星人的加载、位置、绘制和更新等属性。alien_invasion.py:主函数。bullet.py:对子弹进行管理的类,负责子弹的绘制、更新。button.py:按钮类,绘制Play按钮。game_function.py:包含实现各种操作所需的函数。game_data.py:存储游戏激活状态和最高分、飞船剩余等信息。scoreboard....
中国剩余定理 POJ - 2891 Strange Way to Express IntegersTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 18085 Accepted: 6103DescriptionElina is reading a book written by Rujia Liu, which introduces a strange way to...
拓展欧几里得 POJ-2115 C LooooopsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 29789 Accepted: 8595DescriptionA Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable != B...
欧拉函数 POJ - 2478 Farey SequenceTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 17846 Accepted: 7153DescriptionThe Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible rational numbers...
ZOJ-1610(区间染色) Count the ColorsTime Limit: 2 Seconds Memory Limit: 65536 KB Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your
最大流最小割 UVA - 10480 题意:输入一个n和m,n为点数,m为边数,接下来m行u, v, w,求1和2不连接的最小花费。解题:最大流最小割定理,要输出割断的边。#include #include #include #include using namespace std;struct node { int from, to, cap, next;} edge[2000000];int dep
最大流 POJ - 3281 DiningTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 17498 Accepted: 7789DescriptionCows are such finicky eaters. Each cow has a preference for certain
欧拉回路+路径 POJ - 2337 CatenymsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 12033 Accepted: 3124DescriptionA catenym is a pair of words separated by a period such that the la
欧拉回路 HDU - 3018 Ant TripTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2873 Accepted Submission(s): 1141Problem DescriptionAnt Country consist o
判断欧拉通路 POJ - 1386 Play on WordsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 12388 Accepted: 4205DescriptionSome of the secret doors contain a very interesting word puzzl
基础判断欧拉通路 HDU - 1878 欧拉回路Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 14626 Accepted Submission(s): 5550Problem Description欧拉回路是指不令笔离开纸面,可画过图中每条边仅一
线段树+dfs HDU - 3974 Assign the taskTime Limit: 15000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2660 Accepted Submission(s): 1120Problem DescriptionThere is a co
线段树(类似延迟标记) HDU - 4027 Can you answer these queries?Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 15572 Accepted Submission(s): 3654Problem Description
思维 CodeForces - 791C C. Bear and Different Namestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn the army, it isn't easy to form
完全无向图 CodeForces - 791B B. Bear and Friendship Conditiontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputBear Limak examines a social network.
ZOJ-1610 线段树区间更新 Count the ColorsTime Limit: 2 Seconds Memory Limit: 65536 KB Painting some colored segments on a line, some previously painted segments may be covered by some the subsequent ones.Your
欧拉回路输出路径 POJ - 1041 John's tripTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8977 Accepted: 3010 Special JudgeDescriptionLittle Johnny has got a new car. He decided to
线段树 Problem B. Billboard Input file: billboard.in Output file: billboard.out Time limit: 3 seconds Memory limit: 256 megabytesAt the entrance to the university, there is a huge rectangular billboard of
线段树+离散化 POJ-2528 Mayor's posters Mayor's postersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 62932 Accepted: 18163DescriptionThe citizens of Bytetown, AB, could not stand that the cand
(打表找循环节)CodeForces - 768C Jon Snow and his Favourite Number C. Jon Snow and his Favourite Numbertime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputJon Snow now has to fight with W
思维(二分思想递归)CodeForces - 768B Code For 1 B. Code For 1time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputJon fought bravely to rescue the wildlings who were att
尺取 POJ - 3320 Jessica's Reading Problem Jessica's Reading ProblemTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 11660Accepted: 3955DescriptionJessica's a very lovely girl wooed by lots of
(双指针尺取) CodeForces - 372A Counting Kangaroos is Fun A. Counting Kangaroos is Funtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n kangaroos with pockets. Each
二分答案 CodeForces - 371C Hamburgers C. Hamburgerstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarpus loves hamburgers very much. He especially ado
前缀和 CodeForces - 776C Molly's Chemicals C. Molly's Chemicalstime limit per test2.5 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputMolly Hooper has n different kinds of chemic
数论(快速幂) HDU-5690 All X All XTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1672 Accepted Submission(s): 729Problem DescriptionF(x,m) 代表一个全是由数字x组成的m位数
数论(多个数gcd) CodeForces757B Bash's Big Day B. Bash's Big Daytime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputBash has set out on a journey to become the greates
DFS POJ - 1426 Find The Multiple Find The MultipleTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 29571Accepted: 12286Special JudgeDescriptionGiven a positive integer n, write a
BFS + 回溯路径 POJ - 3984 迷宫问题 迷宫问题Time Limit: 1000MSMemory Limit: 65536KTotal Submissions: 19199Accepted: 11317Description定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0,
三维BFS POJ - 2251 Dungeon Master Dungeon MasterTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 30504Accepted: 11842DescriptionYou are trapped in a 3D dungeon and need to find the qui
DP(最长上升子序列) HDU-1087 Super Jumping! Jumping! Jumping!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 36016 Accepted Submission(s): 16419Problem Descri
DP-多组01背包 POJ-3211 Washing ClothesTime Limit: 1000MSMemory Limit: 131072KTotal Submissions: 9924Accepted: 3188DescriptionDearboy was so busy recently that now he has piles of cl
DFS深搜 + 奇偶剪枝 HDU-1010 Tempter of the BoneTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 115837 Accepted Submission(s): 31450Problem DescriptionThe dog
Bfs广搜 HDU - 2612 Find a wayTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12638 Accepted Submission(s): 4060Problem DescriptionPass a year learni
母函数 初步刷题 Ignatius and the Princess IIITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20011 Accepted Submission(s): 14004Problem Description
母函数详解及模板 在数学中,某个序列的母函数(Generating function,又称生成函数)是一种形式幂级数,其每一项的系数可以提供关于这个序列的信息。使用母函数解决问题的方法称为母函数方法。母函数可分为很多种,包括普通母函数、指数母函数、L级数、贝尔级数和狄利克雷级数。对每个序列都可以写出以上每个类型的一个母函数。构造母函数的目的一般是为了解决某个特定的问题,因此选用何种母函数视乎序列本身的特性和
记忆化搜索 HDU-1078 FatMouse and CheeseTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9154 Accepted Submission(s): 3844Problem DescriptionFatMouse has
思维 POJ-1323 Game PredictionTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 10745Accepted: 5189DescriptionSuppose there are M people, including you, playing a speci
动态规划 HDU-2577 How to TypeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6519 Accepted Submission(s): 2932Problem DescriptionPirates have fin
HDU-5178 pairsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2492 Accepted Submission(s): 927Problem DescriptionJohn has n points on
DP(动态规划)个人学习-初步 动态规划是一种重要算法,其思想,在我个人理解来看,就是把问题逐步地进行简化,从一个看似复杂的问题,将问题化小,简化到可以用某条公式(状态转移方程)逐步求出每种状态的解,直到最后求出所要的答案。比如01背包问题,背包容量有限,要尽可能装入价值大的物品,我们可以假设一个dp数组,其中dp[j]表示在容量为j的情况下最多能装入多少价值的物品,这样就把问题简化到求一个个状态了,但是明显还是不够用来解决
贪心 CodeForces - 747D Winter Is Coming D. Winter Is Comingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe winter in Berland lasts n days. For ea
简单模拟 CodeForces - 404B Marathon B. Marathontime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputValera takes part in the Berland Marathon. The mar
DFS(思维) CodeForces - 525D Arthur and Walls D. Arthur and Wallstime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputFinally it is a day when Arthur has enough money for buying a
HDU - 1176 免费馅饼 免费馅饼Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 44630 Accepted Submission(s): 15405Problem Description都说天上不会掉馅饼,但有一天gameboy正走
CodeForces - 598D Igor In the Museum D. Igor In the Museumtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIgor is in the museum and he wants to see as many pictures a
DP(01背包) HDU-2159 FATE FATETime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12667 Accepted Submission(s): 5992Problem Description最近xhd正在玩一款叫做FATE的游戏,为了
思维 CodeForces - 651B Beautiful Paintings B. Beautiful Paintingstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n pictures delivered for the new exhi
欢迎使用CSDN-markdown编辑器 欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl
基础题 CodeForces - 631B Print Check B. Print Checktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputKris works in a large company "Blake Technologies". As
给定数轴上n个点,找出其中一个点使其到其他各个点距离之和最小。 答案:最优解是这些数的中位数。 证明: 假设数轴上有7个点,取一点A使其右边为4个点,左边为3个点。A左移距离d,则对于右边4个点,距离共减少4d,左边增加3d,总体距离之和减少了1d。 同理取点B使右边3个点,左边4个点,向左移动,也可得到距离减少。 因此,若该点两边输入点数量不一样,就不是最优解。 当点个数为奇数,最优解是中位数。 当点个数为偶