![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 51
Jack_zhuiyi
这个作者很懒,什么都没留下…
展开
-
开始刷BZOJ的计划
感觉自己太菜了,不刚一波是不行了,况且今天才知道bzoj就是衡阳八中oj????我也是个衡阳人???为毛这么弱鸡。原创 2018-03-30 11:07:37 · 280 阅读 · 0 评论 -
poj Number Sequence
Number Sequence Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 40636 Accepted: 11825Description A single positive integer i is given. Write a program to find the digit locate原创 2017-12-02 17:15:54 · 223 阅读 · 0 评论 -
H - Tiling a Grid With Dominoes HDU - 1992
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1992 We wish to tile a grid 4 units high and N units long with rectangles (dominoes) 2 units by one unit (in either orientation). For example, the f原创 2017-11-16 22:26:09 · 280 阅读 · 0 评论 -
J - Examining the Rooms HDU - 3625
A murder happened in the hotel. As the best detective in the town, you should examine all the N rooms of the hotel immediately. However, all the doors of the rooms are locked, and the keys are just loc原创 2017-11-16 19:16:52 · 338 阅读 · 0 评论 -
B - The Pilots Brothers' refrigerator POJ - 2965
The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator.There are 16 handles on the refrigerator door. Every handle can be in one of two st原创 2017-11-21 20:49:36 · 291 阅读 · 1 评论 -
B - Find the maximum HDU - 4002
Euler's Totient function, φ (n) [sometimes called the phi function], is used to determine the number of numbers less than n which are relatively prime to n . For example, as 1, 2, 4, 5, 7, and 8, are a原创 2017-11-14 15:08:18 · 167 阅读 · 0 评论 -
A - Strange Billboard HDU - 1882
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1882 The marketing and public-relations department of the Czech Technical University has designed a new reconfigurable mechanical Flip-Flop Bill-Board原创 2017-11-18 14:17:09 · 308 阅读 · 0 评论 -
D - Key Task HDU - 1885
链接: http://acm.hdu.edu.cn/showproblem.php?pid=1885 The Czech Technical University is rather old — you already know that it celebrates 300 years of its existence in 2007. Some of the university b原创 2017-11-17 22:04:15 · 203 阅读 · 0 评论 -
二进制枚举子集
用二进制中1表示有,0表示无,数组作为集合可枚举所有子集。#include <cstdio>#include <string>#include <iostream>using namespace std;int a[5] = { 6,5,7,8,9 };void print(int s) { for (int i = 0; i < 5; ++i) { if (s &原创 2017-10-25 15:01:50 · 310 阅读 · 0 评论 -
C++string的坑点
string str,之前直接用str[k] = ‘\0’,实际上并没有改变string.length(); 如果这个时候直接cout << str,此时会打印其中的’\0’,而’\0’在内存中相当于一个空格。原创 2017-10-24 21:54:08 · 496 阅读 · 0 评论 -
A - Balanced Number HDU - 3709
A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box with weight indicated by the digit. When a pivot is p原创 2017-10-13 17:10:37 · 274 阅读 · 0 评论 -
快速排序优化
快速排序优化版。 1.从low,right,mid = (low + right) >> 1 中选择中间的数作枢纽。 2.将与枢纽相同的数通过先放入边缘两边,再放到枢纽旁边,防止重复数组带来的时间消耗。#include <cstdlib>#include <iostream>#include <cstdio>#include <ctime>using namespace std;int原创 2017-10-22 18:44:27 · 216 阅读 · 0 评论 -
F - Just a Hook HDU - 1698
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1698 In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive met原创 2017-12-11 22:25:34 · 194 阅读 · 0 评论 -
G - Billboard HDU - 2795
At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcements are posted: nearest pr原创 2017-12-12 09:51:50 · 199 阅读 · 0 评论 -
F - S-Trees UVA - 712
#include #include #include #include #include #include #include #include #include #include #include using namespace std;#define INF 0x3f3f3f3fint main() { char str[8][5], a[10], c[10]; i原创 2018-02-07 22:03:46 · 184 阅读 · 0 评论 -
1001. A+B Format (20)
时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueCalculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there ar...原创 2018-02-12 14:46:31 · 199 阅读 · 0 评论 -
C - Spreadsheet Calculator UVA - 215
#include #include #include #include #include #include #include #include #include using namespace std;#define INF 0x3f3f3f3fint m, n;int flag[25][15];//判定是否死锁 0表示已解锁,1表示待解锁,2表示死锁char str[2原创 2018-01-29 12:37:03 · 235 阅读 · 0 评论 -
A - Tree Reconstruction UVA - 10410
#include #include #include #include #include #include #include using namespace std;#define INF 0x3f3f3f3fint main() { int n, pos[1005], root; stack s; vector v[1005]; while (cin >> n) {原创 2018-01-26 14:43:33 · 189 阅读 · 0 评论 -
HDU2896
病毒侵袭 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 31721 Accepted Submission(s): 7247Problem Description 当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时原创 2017-12-24 10:56:46 · 244 阅读 · 0 评论 -
E - 循环 HDU - 1358
For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the prefix is a periodic string. That is, for each i (2 <原创 2017-12-15 13:10:06 · 248 阅读 · 0 评论 -
E - Ultra-QuickSort POJ - 2299 线段树离线
In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted in原创 2017-12-13 11:36:07 · 287 阅读 · 0 评论 -
E - The Embarrassed Cryptographer POJ - 2635
The young and very promising cryptographer Odd Even has implemented the security module of a large system with thousands of users, which is now in use in his company. The cryptographic keys are created原创 2017-12-04 19:59:54 · 231 阅读 · 0 评论 -
D - Paths on a Grid POJ - 1942
链接:http://poj.org/problem?id=1942 Imagine you are attending your math lesson at school. Once again, you are bored because your teacher tells things that you already mastered years ago (this time h原创 2017-12-04 19:21:14 · 168 阅读 · 0 评论 -
H - Super Mario HDU - 4417
Mario is world-famous plumber. His “burly” figure and amazing jumping ability reminded in our memory. Now the poor princess is in trouble again and Mario needs to save his lover. We regard the road to原创 2017-12-12 15:10:06 · 401 阅读 · 0 评论 -
G - Next[]树 CodeForces - 432D
You have a string s = s1s2...s|s|, where |s| is the length of string s, and si its i-th character.Let's introduce several definitions: A substring s[i..j] (1 ≤ i ≤ j ≤ |s|) of string s is string sis原创 2017-12-20 18:09:25 · 295 阅读 · 0 评论 -
B - Points on Cycle
There is a cycle with its center on the origin. Now give you a point on the cycle, you are to find out the other two points on it, to maximize the sum of the distance between each other you may ass原创 2017-10-03 20:58:53 · 270 阅读 · 0 评论 -
H - Post Office POJ - 1160
There is a straight highway with villages alongside the highway. The highway is represented as an integer axis, and the position of each village is identified with a single integer coordinate. There ar原创 2017-09-09 23:51:38 · 330 阅读 · 0 评论 -
CSU-ACM2017暑期训练6-bfsH - ACM小组的古怪象棋 CSU - 1224
ACM小组的Samsara和Staginner对中国象棋特别感兴趣,尤其对马(可能是因为这个棋子的走法比较多吧)的使用进行深入研究。今天他们又在 构思一个古怪的棋局:假如Samsara只有一个马了,而Staginner又只剩下一个将,两个棋子都在棋盘的一边,马不能出这一半棋盘的范围,另外这 一半棋盘的大小很奇特(n行m列)。Samsara想知道他的马最少需要跳几次才能吃掉Staginner的将(我们原创 2017-08-02 08:48:11 · 487 阅读 · 0 评论 -
CSU-ACM2017暑假集训比赛3D - D CodeForces - 557C
Arthur has bought a beautiful big table into his new flat. When he came home, Arthur noticed that the new table is unstable.In total the table Arthur bought has n legs, the length of the i-th leg is li原创 2017-08-08 09:49:33 · 1778 阅读 · 0 评论 -
2017年集训队第四场选拔赛 -string Game
Problem A: String GameTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 55 Solved: 20[Submit][Status][Web Board]DescriptionAlice and Bob are playing the following game with strings of lett原创 2017-07-14 06:37:30 · 613 阅读 · 0 评论 -
2017年集训队第四场选拔赛Trainsorting
Problem E: Problem B: TrainsortingTime Limit: 1 Sec Memory Limit: 128 MBSubmit: 199 Solved: 66[Submit][Status][Web Board]DescriptionProblem B: TrainsortingErin is an engineer. She原创 2017-07-14 07:14:09 · 647 阅读 · 0 评论 -
没事刷刷题之三(简单英文题)I - Boredom
简单动规原创 2017-07-12 15:43:20 · 1266 阅读 · 0 评论 -
HDU 1063Exponentiation
ExponentiationTime Limit: 2000/500 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9385 Accepted Submission(s): 2775Problem DescriptionProblems involvi原创 2017-04-14 13:22:12 · 413 阅读 · 0 评论 -
贪心过河问题
过河问题时间限制:1000 ms | 内存限制:65535 KB难度:5描述 在漆黑的夜里,N位旅行者来到了一座狭窄而且没有护栏的桥边。如果不借助手电筒的话,大家是无论如何也不敢过桥去的。不幸的是,N个人一共只带了一只手电筒,而桥窄得只够让两个人同时过。如果各自单独过桥的话,N人所需要的时间已知;而如果两人同时过桥,所需要的时间就是走得比较慢的那个人单独行动时所需的时间。原创 2017-04-05 16:39:59 · 595 阅读 · 0 评论 -
HDU4515小Q系列故事——世界上最遥远的距离
HDU4515 世界上最遥远的距离 不是生与死 而是我就站在你面前 你却不知道我爱你 世界上最遥远的距离 不是我就站在你面前你却不知道我爱你 而是明明知道彼此相爱 却不能在一起 世界上最遥远的距离 不是明明知道彼此相爱却不能在一起 而是相约好了私奔的时间 我穿越到了未来 你却回去了古代 ――摘自《小Q失恋日记 》第117卷513页 当小Q使出浑身解原创 2017-04-04 21:59:02 · 414 阅读 · 0 评论 -
HDU1058Humble Numbers
Humble NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 25555 Accepted Submission(s): 11268Problem DescriptionA number whos原创 2017-04-10 18:04:50 · 382 阅读 · 0 评论 -
HDU1055Color a tree
Color a Tree Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2270 Accepted Submission(s): 824Problem Description Bob is very interested in原创 2017-04-08 07:09:56 · 538 阅读 · 0 评论 -
csu-acm2017暑假集训2-二分搜索D - Monthly Expense
Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤ 10,000) that h原创 2017-07-25 15:29:31 · 594 阅读 · 0 评论 -
CSU-ACM2017暑期训练7-模拟&&贪心A - Radar Installation
Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locating on the c原创 2017-08-03 08:42:53 · 1578 阅读 · 0 评论 -
G - To the Max POJ - 1050
Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectangle is the sum of原创 2017-09-09 13:01:17 · 285 阅读 · 0 评论