|Time Limit: 1000MS||Memory Limit: 30000K|
|Total Submissions: 3907||Accepted: 1282|
Any sequence of between 2 to 9 identical characters is encoded by two characters. The first character is the length of the sequence, represented by one of the characters 2 through 9. The second character is the value of the repeated character. A sequence of more than 9 identical characters is dealt with by first encoding 9 characters, then the remaining ones.
Any sequence of characters that does not contain consecutive repetitions of any characters is represented by a 1 character followed by the sequence of characters, terminated with another 1. If a 1 appears as part of the sequence, it is escaped with a 1, thus two 1 characters are output.
if (str[i] == str[i+1])
for ( j = i ; str[i] == str[i+1] && (i-j) < 8 ; i++ );
printf("%d%c", i-j+1, str[i]);
memset(str, 0, sizeof(str));
- SDUT 2352 Run Length Encoding
Let me see the title The question : Encode the given string , The coding rules are based on two ,1. If there are consecutive equal characters in a string , It becomes two characters , One is the number of the same characters in succession , The other is this character , But if the number exceeds 9 individual , Then output 9 Then the output ...
- Two-Pointer And Run Length Coding (RLC)
Run length encoding (Run Length Coding, RLC) It is a common preprocessing method in string processing . It is written in a typical double pointer (Two-Pointer). The following is a summary of its writing 1. Input as a string of integers, you can not store integers in the array
- Count and Say (Array Length Encoding) -- LeetCode
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...
- POJ 1579-Function Run Fun（ Memory search ）
Function Run Fun Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 16503 Accepted: 8514 ...
- Run length encoding （Run Length Code）
One . What is run length coding Run length coding is a relatively simple compression algorithm , The basic idea is to use repeated and continuous characters ( The number of consecutive occurrences , A certain character ) To describe . Like a string : AAAAABBBBCCC Run length coding can be used to describe ...
- POJ.1379.Run Away( Simulated annealing )
Topic link POJ The output can't be used %lf! mmp from 4:30 Change to 6:00, hold 4:30 The output has been changed . So there are two pieces of code .. //392K 500MS // Update with a rectangle of two points , You don't have to worry about boundaries #inc ...
- poj 1379 Run Away Simulated annealing difficulty :1
Run Away Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 6482 Accepted: 1993 Descript ...
- POJ 1379 Run Away
The question : Yes n Trap , stay X,Y A point in the range is required to make the minimum distance from the point to the trap maximum . Ideas : Simulated annealing , Randomly sprinkle 40 A little bit , Then simulated annealing randomizes the movement . ( This question poj Cheating father , added srand(time(NULL)) Can't pay ...
- POJ 1379 Run Away 【 Basic simulated annealing 】
The question : Find out a little , The shortest distance from all points is the largest Two dimensional in-plane simulated annealing is enough , It is also possible to cover the problem with the smallest circle . Source Code: //#pragma comment(linker, "/ST ...
- 【 tencent bugly Dry cargo sharing 】HTML 5 Live video one stop literacy
This article is from Tencent bugly Developer community , Without the consent of the author , Do not reprint , Original address :http://bugly.qq.com/bbs/forum.php?mod=viewthread&tid=1277 Video straight ...
- swift Learning notes -UI Chapter UIImageView
1. Basic use Drag the image you want to use into the project , I'm using the name “1.jpg” Pictures of the , Then create UIImageView, And set the image to be displayed as "1.jpg"//1. Basic use let im ...
- Milking Time
Description Bessie is such a hard-working cow. In fact, she is so focused on maximizing her producti ...
- nignx note 1
Here's a single version of the architecture , There is one theory tomcat Concurrent on 200 To 300, The most optimized 500, It's obviously low capacity , Moreover, after a single point of failure, the application service can not be accessed , such as tomcat, This is obviously not good for multi concurrency . So if I ...
- 【 Problem solving 】jhipster-registry-master Blank pages
Summary of problems : Just from github Pulled down jhipster-registry-master Direct operation , visit http://localhost:8761 You'll find a blank page , But the website's title According to the normal , The purpose of this paper is to solve ...
JS Pull out the common function problem After going through " A lot of " After the development of the project , More and more methods can be pulled out and used as a public method . that , stay js How to realize this idea in the process of development ? answer for example , The following methods are used to implement the standard ...
5.1 Object type 1: establish Object Two ways of instance ①new Construction var obj1 = new Object(); Pay attention to capitalization ! You can omit parentheses when you don't pass parameters obj1.hehe = &quo ...
- ELK 5.6.8 Installation and deployment
Operating system version : LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64: ...
- Node.js Version management tools nvm
1. Download and install curl curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash wge ...
- dnn ubuntu problem
http://blog.csdn.net/moshuilangting/article/details/53926622 http://blog.csdn.net/enjoyyl/article/de ...