The rulers in Word are by default in characters, and in practical applications it is not good for us to calculate the size of the paper. In many cases, such as printing documents, papers, pictures and so on need to specify the size, to be in Word in advance to set a long width, then we need to change the ruler unit to centimeters, to facilitate our confirmation size.
1. The unit of measure in the current document is a character. Click the Office Butt
Problem descriptionHave a10\leq10≤ length\leq 1,000,000≤1,000,00 0strings, consisting only of lowercase letters. How many substrings are available, containing at least K (1 \leq k \leq)K(1≤k≤26) different letters? Enter a descriptionThe input contains multiple sets of data. The first line has an integert (1\leq t\leq) t (1≤t≤1ss. The second line enters an integer kk. Output descriptionFor each set of data, the output meets the required number of substrings.Input sample2abcabcabca4abcabcabcabc3
O (n) to enumerate all segments with a length of K, each violent transfer.
During the transfer, only one number is inserted from the end and one number is deleted from the front.
Calculate the current Max and Min values.
These operations are O (logn) with the Multiset (distinct element is rewritable.
1 #include
[Ruler acquisition method] [Multiset] bzoj1342 [baltic2007] sound mute Problem
Test instructionsIn a sequence of length n, find the shortest length sequence so that it is greater than or equal to s;Ideas:pointer, water problem;AC Code:#include /*#include */using namespacestd;#definefor (i,j,n) for (int i=j;i#defineRiep (n) for (int i=1;i#defineRIOP (n) for (int i=0;i#defineRJEP (n) for (int j=1;j#defineRJOP (n) for (int j=0;j#defineMST (SS,B) memset (ss,b,sizeof (ss));typedefLong Longll;templateclassT>voidRead (tnum) { CharCH;BOOLf=false; for(Ch=getchar (); ch'0'|| Ch>
A Bit FunTime limit:5000/2500 MS (java/others) Memory limit:32768/32768 K (java/others)Problem descriptionthere is n numbers in a array, as A0, A1 ..., an-1, and another number M. We define a function f (i, j) = ai|ai+1|ai+2| ... | Aj. Where "|" is the bit-or operation. (I The problem is really simple:please count the number of the different pairs of (I, J) where F (i, J) Inputthe first line has a number T (T For each test case, first line contains, numbers n and M. (1 Outputfor every case, you
Title Link: Http://codeforces.com/problemset/problem/660/CRuler, each time you encounter 0 of the time to fill a 1, until the completion or out of bounds. Each time a 0 point is recycled from left to right. The recording path is jammed with two pointers, each updated.1#include 2#include 3#include 4#include 5#include 6#include 7#include 8#include 9#include Ten#include One#include A#include -#include -#include the#include -#include Set> -#include -#include + - using namespacestd; + A Con
POJ3320 Jessica ' s Reading problemSet is used to count the number of all non-repeating knowledge points, and map is used to maintain the number of occurrences of each knowledge point on the interval [s,t], which is a good representation of the flexible application of map #include #include#include#include#include#include#include#includeSet>#includestring>#includeusing namespacestd;Const intINF =0x3f3f3f3f; typedefLong Longll;Const intMax_p =1000010;intP;inta[max_p];intMain () {scanf ("%d", q);
A-Fried chicken want to lose weight of stringTime limit:MS Memory Limit:65535KB 64bit IO Format:SubmitStatusPracticenbut 1576DescriptionOnce upon a time, there was a string of long, long strings consisting of n lowercase letters.One day when it was looking in the mirror, he felt too fat, so he wanted to lose weight. When you lose weight, you can constantly remove the first or last character.After it wants to lose weight, for a slim factor m, the slim factor must contain ' a ', ' B ', ' C ' ...
Title: http://poj.org/problem?id=3320Test instructions: Given an array of n elements, find the shortest interval so that the element type within the interval equals the element type of the entire array.Analysis: The beginning of the violent enumeration interval x, and then find the smallest y, so that the interval [x, y] satisfies the condition, X shifted to the X ', now Y ' certainly not on the left of Y. Both map and hash can be used.Map Code:#include Hash code:#include POJ 3320 Jessica ' s Re
Poj3320 (ruler acquisition) and poj3320
N number. The minimum interval overwrites all the different numbers in n number.
Solution:
AC code:
Import java. util. hashMap; import java. util. hashSet; import java. util. map; import java. util. imports; import java. util. set; public class Main {/*** @ param args */static int n; static Set
Jessica‘s text-book. The second line contains P non-negative integers describing what idea each page is about. The first integer is what the first page is about, the second integer is what the second page is about, and so on. You may assume all integers that appear can fit well in the signed 32-bit integer type.
Output
Output one line: the number of pages of the shortest contiguous part of the book which contains all ideals covered in the book.
Sample Input
51 8 8 8 1
Sample output
2
AC cod
Subsequence
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 9050
Accepted: 3604
DescriptionA sequence of n positive integers (InputThe first line is the number of test cases. The program have to read the numbers N and S, separated by a interval, from the first line. The numbers of the sequence is given in the second line of the "test case", separated by intervals. The input would finish with the end of file.OutputThe the
A series integer a0,a1......an-1 and integer s with a given length of N. The minimum value of the length of a continuous sub-sequence with a sum not less than S is calculated. If the solution does not exist, the output is 0.Input n=10S=15a=[5,1,3,5,10,7,4,9,2,8]Output2 [5,10]functionsolve () {varRes=n+1; varS=0,t=0,sum=0; for(;;) { while(tS) {Sum+=a[t++]; } if(Sum Break} res=math.min (res,t-s); Sum-=a[s++]; } if(res>N) { //solution does not existRes=0; } returnRes;}Do the f
Final effect:
The specific drawing steps are as follows:
Step one: Draw a 21cm*2.3cm rectangle with a rectangular tool, the color size of the Shahuang (0,20,40,0)
Step two: This is a 20-centimeter ruler, which draws a straight line with a pen or Bezier tool,
Spacing is 5MM, (at 5mm in each place a slightly elongated straight line, in every 1cm in the straight pull
Long), and then draw a horizontal line, as shown below
When you open the Word window, you will see a row of rulers above the window, followed by 2, 4, 6 ... 38, it is in the character unit, in the song body fifth Word format, each row can enter about 38 Chinese characters. But sometimes it is not convenient to use, especially in the tabulation, drawing, it is not intuitive, at this time, we can modify the ruler in centimeters.
Click the tools → options command, and in the Options dialog box that pops up,
Tags: span int orm Tom SEL round convert floating point number problem The problem of formatting the floating-point number, using Format (col,2) to retain the two-bit decimal point, there is a problem, such as the following statement, after we give a workaround SELECT FORMAT (12562.6655,2);
Results: 12,562.67 View Document: Formats The number X to a format like ' #,###,###.## ', rounded to D decimal places
Boring countTime limit:2000/1000 MS (java/others) Memory limit:32768/32768 K (java/others)Total submission (s): 932 Accepted Submission (s): 382Problem descriptionyou is given a string S consisting of lowercase letters, and your task is counting the number of subst The ring, the number of each lowercase, the substring is no more than K.Inputin The first line there was an integer T, indicates the number of test cases.For each case, the first line contains a string which only consist of lowercase
24-segment magic ruler, which of the following exquisite patterns can be folded
What are the exquisite patterns that can be stacked with the 24-segment magic ruler?
The ball, the turtle, the cross, the three-leaf flower, the triangle, the ox lord, and the notes are quite familiar to everyone.
I am more interested in this issue. First, we will show the 24 magic tricks on the Internet with exquisite patter
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.