Let's use B the letter to denote "hundred", the letter S means "Ten", 12...n to represent a non-zero digit n (234 , it should be output BBSSS1234 because it has 2 "hundred", 3 "ten", and a single digit of 4. Input Format:Each test input contains 1 test cases, giving a positive integer N (output Format:The output of each test case is one line, and n is output in the specified format . Input Sample 1:234Output Example 1:BBSSS1234Input Sample 2:23Output Example 2:SS123Analysis:Three digit
Let us use the letter B to denote "hundred", the letter S for "Ten", "12...N" to represent the single digit n (input Format: each test input contains 1 test cases, giving a positive integer n (Output format: one row for each test case output n in the specified format.Input Sample 1:234Output Example 1:BBSSS1234Input Sample 2:23Output Example 2:SS123Accept integers with strings, eliminating the number of digits to judge integers#include #includestring.h>intMain () {Chara[Ten]; scanf ("%s", a); in
1006 Questions:Problem DescriptionThe three hands of the clock is rotating every second and meeting all other many times everyday. Finally, they get bored of this and all of the them would like to stay away from the other. A Hand is happy if it's at least D degrees from any of the rest. You is to calculate what much time in a day and all the hands is happy.InputThe input contains many test cases. Each of them have a single line with a real number D be
-intersecting lines, then it may have four cases in the previous step:The first point from the top walk, the second point also from the top, at this time of goodwill and for F[i-1][j][k-1][l] + a[i][j] + a[k][l]The first point comes from the top, the second point is left to come, at this time the goodwill and for F[I-1][J][K][L-1] + a[i][j] + a[k][l], but at this time should consider whether the point above the first point will coincide with the point to the left of the second point, if coincide
Question link: http://acm.pku.edu.cn/JudgeOnline/problem? Id = 1006
This question mainly uses the Chinese Remainder Theorem
1. remainder problem: in integer division, a number is divided by several pairs of mutual quality numbers at the same time. After an integer operator, there are remainder numbers, it is known that each divisor and its corresponding remainder are used to obtain the divisor that meets the conditions.
2. Chinese Remainder Theorem: D
Question address: http://poj.org/problem? Id = 1006 lang = default change = true
This is the question of a deformed Sun Tzu's theorem, which is used directly by formulas.
CodeAs follows:
# Include
distance between these two rankings is 2. the median ranking of a set of rankings is that ranking whose sum of distances to all the given rankings is minimal. (note we cocould have more than one median ranking .) the median ranking may or may not be one of the given rankings.
Suppose there are 4 voters that have given the rankings: abdce, bacde, abced and acbde. consider two candidate median rankings ABCDE and cdeab. the sum of distances from the ranking ABCDE to the four voted rankings is 1 +
Simple physiological Cycle Simulation
Perform the remainder operation when the value exceeds 23*28*33 (21252.
#include
China Remainder TheoremIf a certain number of X is D1 ,,... The remainder of the DN division is R1, R2 ,... , RN, can be expressed as the following formula:X = r1r1 + r2r2 +... + Rnrn + RdR1 is D2, D3 ,... , DN public multiple, and division by D1, the remainder is 1;R1, R2... ,
RN is D1, D2 ,... , The dn-1 of the public multiple, And the DN division, the remain
1006. Sign in and sign out (25) Time Limit 400 MS
The memory limit is 32000 kb.
Code length limit: 16000 B
Criterion author Chen, Yue
At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. given the records of signing in's and out's, you are supposed to findOnes who have unlocked and locked the door on that day.
Input specification:
Each input file contai
1006: [hnoi2008] Time Limit: 20 sec memory limit: 162 MB
Submit: 1788 solved: 775
[Submit] [Status]
Description
K is a country keen on triangles, and even people only like the triangle principles. they believe that the triangular relationship: AB, BC, and Ca are concise and efficient. in order to consolidate the triangular relationship, K countries prohibit the existence of four-edge relations, five-edge relations, and so on. the so-called n-edge re
HDU 5358 (2015 Multi-school joint training competition 1006) First One (range merging + constant optimization), hdu training competition
HDU 5358
Question:
Calculate Σ I = 1n Σ j = in (⌊ log2S (I, j) records + 1) records (I + j ).
Ideas:
S (I, j)
It is mainly difficult to write, some details are tangled, and some ideas are clarified before writing.
Ps. The unit constant is unhuman. Remember to pre-process the interval ing. Otherwise, n (logn) ^ 2 wil
HDU 3788 and 9du OJ 1006 test data are different, hduojZOJ ProblemsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission (s): 2935 Accepted Submission (s): 889Problem Description determines whether a given string (only contains 'Z', 'O', and 'J') can be AC.The AC rules are as follows:1. zoj can communicate with each other;2. If the string format is xzojx, it can also be AC, where x can be N 'O' or is empty;3.
not understand. Basically it means to mark a picture from the beginning of the big, at the same time for points connected to the mark Point du++, the next mark is unmarked Point du the largest point, so as to form a queue in order to dye the queue, each Dianran the smallest color is OK, I do not know why this is right ...1#include 2 intn,m,cnt,ans,u,v,x,t;3 inthead[10005],du[10005],q[10005],col[10005],hash[10005];4 BOOLvis[10005];5 structdata{intTo,next;} e[2000005];6 voidInsintUintv)7{e[++cnt]
0;}4. Operation Results and AnalysisStart Page and help :dir command:CD command:Date command:Time command:Iv. Summary of the experimentIt is not difficult to write a DOS command interpreter, but it takes some time to do it. Defines an array that holds commands and uses the STRCMP function to determine whether strings are equal. In the process of running the error, is a two-dimensional array of numbers set too small to cause problems, after modification, there is no error. This clearly shows the
Input23 31 22 33 14 41 22 33 44 1Sample Output02Test instructions: Give an image without a direction. The edges are dyed white or black in turn, so that the number of white and black edges associated with each point is the same. Ask how many methods of staining are available.Ideas:Search questions. Forced violence searches must be timed out. Enumeration points to search is also not good to write. So enumerate the edges.Record the degree of each point, if a bit of degrees is odd, direct output 0
HDU 5358Test instructionsBeg ∑ i = 1 n ? ∑? J=i ? N ??(?Lo g? 2 ??S(I,J)?+1)?(I+J). Ideas:S (i,j) Mainly write it is more difficult to some, some details more tangled, a certain way of thinking to clarify and then write.PS. This card constant is not human, you must remember to preprocess the interval mapping, otherwise n (logn) ^2 also have to kneel.Code/** @author novicer* language:c++/c*/#include
Copyright notice: Bo Master said authorized all reproduc
-old can be fu chess what result, the Cai Wenji can distinguish the piano Shaidao can sing the harp and Conning men when the Tang Liu Yanfang seven-year-old to raise a child prodigy, although the young body has been er young learning mian and to Night Watch chicken crows louder than gou do not learn Horeb for silkworm silk honey people do not learn as well as things young and learn strong and go to June under Zeminyan fame parents light in front Yu in the descendants of the son Kim I teach son b
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.