- 博客(20)
- 收藏
- 关注
原创 C++重载运算符详解
C++允许我们为我们的类重定义或重载大部分C++内置的运算符。这样我们的类就可以通过这些运算符进行一些操作。比如加减乘除,赋值比较等。重载的运算符是带有特殊名称的函数,函数名是由关键字 operator 和其后要重载的运算符符号构成的。与其他函数一样,重载运算符有一个返回类型和一个参数列表。 比如我们要给复数类Complex重载加法运算符:Complex operator+(Complex...
2018-06-02 16:58:35 1282
原创 Codeforces 987C Three displays(思维)
C. Three displaystime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt is the middle of 2018 and Maria Stepanovna, who lives outside Krasnokamensk (a ...
2018-05-30 16:08:19 232
原创 Codeforces 982C Cut 'em all! (dfs)
C. Cut 'em all!time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou're given a tree with nn vertices.Your task is to determine the maximum possible ...
2018-05-28 21:44:53 413
原创 ZOJ 4034 Mahjong Sorting
Mahjong SortingTime Limit: 1 Second Memory Limit: 65536 KBDreamGrid has just found a set of Mahjong with suited tiles and a White Dragon tile in his pocket. Each suited tile has a suit (Characte...
2018-05-13 22:08:17 292
原创 单链表总结 (链表的创建、插入、删除、排序等)
本文中链表都是没有头结点的,即头指针指向的结点就存数据,head==NULL链表为空 链表就是一种线性表,优点是不用事先知道要开多少空间、有多少数据,插入删除数据快,相对的,缺点就是不能像数组那样直接访问第i个数据,因此不能快速排序。一、结点struct node{ int data; //链表中存储的数据 struct node* next; ...
2018-05-07 22:28:59 606
原创 POJ-1797 Heavy Transportation(最大生成树/最短路)
Heavy TransportationTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 44305 Accepted: 11608DescriptionBackground Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now ...
2018-05-01 16:05:43 177
原创 zoj-3829 Known Notation(贪心)
Known NotationTime Limit: 2 Seconds Memory Limit: 65536 KBDo you know reverse Polish notation (RPN)? It is a known notation in the area of mathematics and computer science. It is also known as po...
2018-04-27 15:55:41 196
原创 CodeForces 922D Robot Vacuum Cleaner(贪心)
D. Robot Vacuum Cleanertime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPushok the dog has been chasing Imp for a few hours already.Fortunately, Imp...
2018-04-26 21:40:43 312
原创 poj 3414 Pots 和 hdu 1495 非常可乐 (bfs)
两道很像的题,都是倒水看你能不能倒出题目要求的样子。BFS模拟倒水过程找到解就行了。PotsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 20762 Accepted: 8856 Special JudgeDescriptionYou are given two pots, having the volume of A and ...
2018-04-26 21:40:37 183
原创 HDU 1180 诡异的楼梯(BFS)
诡异的楼梯Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 17256 Accepted Submission(s): 4529Problem DescriptionHogwarts正式开学以后,Harry发现在Hogwarts里,某...
2018-04-26 21:40:26 162
原创 CodeForces 922B Magic Forest(暴力)
B. Magic Foresttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputImp is in a magic forest, where xorangles grow (wut?)A xorangle of order n is such a...
2018-04-25 10:41:23 173
原创 CodeForces 862B Mahmoud and Ehab and the bipartiteness(二分图)
B. Mahmoud and Ehab and the bipartitenesstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMahmoud and Ehab continue their adventures! As everybody ...
2018-04-25 10:40:47 222
原创 codeforces 899D Shovel Sale(数学)
D. Shovel Saletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n shovels in Polycarp's shop. The i-th shovel costs i burles, that is, the ...
2018-04-25 10:40:16 291
原创 HDU 1728 逃离迷宫 (bfs)
给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行走过程中,gloria不能走到迷宫外面去。令人头痛的是,gloria是个没什么方向感的人,因此,她在行走过程中,不能转太多弯了,否则她会晕倒的。我们假定给...
2018-04-25 10:39:39 320
原创 Codeforces 893C Rumor (带权并查集)
C. Rumortime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVova promised himself that he would never play computer games... But recently Firestorm — ...
2018-04-25 10:38:51 286
原创 codeforces 935C Fifa and Fafa
C. Fifa and Fafatime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFifa and Fafa are sharing a flat. Fifa loves video games and wants to download a ne...
2018-04-25 10:38:20 575
原创 codeforces 940A Points on the line (思维)
Points on the line题面:We've got no test cases. A big olympiad is coming up. But the problemsetters' number one priority should be adding another problem to the round.The diameter of a multiset of poin...
2018-04-25 10:37:50 223
原创 POJ-1877 Flooded!(贪心模拟)
To enable homebuyers to estimate the cost of flood insurance, a real-estate firm provides clients with the elevation of each 10-meter by 10-meter square of land in regions where homes may be purchased...
2018-04-25 10:36:58 309
原创 UVA 253 Cube painting
题意就是给一个正方体涂色,判断两次涂的是不是一样的,能旋转成一样样子就算作一样。InputThe input of your program is a textfile that ends with the standard end-of-file marker. Each line is a string of 12 characters. The first 6 characters of t...
2018-04-25 10:36:13 158
原创 HDU 1556 Color the ball(区间离散化)
题面:N个气球排成一排,从左到右依次编号为1,2,3….N.每次给定2个整数a b(a <=b), 但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了, 你能帮他算出每个气球被涂过几次颜色吗?Input每个测试实例第一行为一个整数N,(N <= 100000).接下来的N行,每行包括2个整数a b(1 <= a <= b <= N)。 当N = 0,输入结束。...
2018-04-25 10:35:14 148
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人