1833: [Zjoi2010]count Digital Count time
limit:3 Sec Memory limit:64 MBsubmit:2494 solved:1101[Submit] [Status] [Discuss]
Description given two positive integers a and B, for all integers in [a, b], how many times each digital (digit) appears. Only one line of two integers a, B, is included in the input file, meaning as described above. The output file contains a row of 10 integers representing the number of times that 0-9 appears in [A, b]. Sample Input1 99Sample Output9 20 20 20 20 20
Topic PortalMain topic:Enter a number of 1 to 81 (9*9) to find the number of digits and equal to s in 1 to 109.Problem Solving Ideas:It is easy to know that a number is equal to the number of S. To make an i-bit number digit and equal to S, you can add 0~9 (if SDP[I][J]=DP[I-1][J-0]+DP[I-2][J-1]+......+DP[I-9][J-9]; where I represents the number of I bits, J denotes s. DP[I][J] Represents an i-bit digit number and the number of schemes for J.#include #include#include#includeusing namespacestd;in
Problem Descriptiona Simple Mathematical formula-E iswhere n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of N. outputoutput the Approximati ONS of e generated by the above formula for the values of n from 0 to 9.The beginning of your output should appear similar to that shown below. Sample outputn e-----------0 2.53 2.6666666674 2.708333333 My Solution:#include #includeusing namespacestd;intMainvoid){ Doublef[ One]; int
() {LED1=! LED1;//The LED1 pin is connected to the cathode of the light emitting tube, the led1=0 is bright, and the led1=1 is extinguished. //Reload Timer if(LED1) tasks[0].td= $;//450mS extinguished Elsetasks[0].td=5;//50ms Bright} //task two, state machine notationCharKeycount=0; voidTask1 () {if(key==0) {Keycount++; if(keycount> -) Iap_contr =0x60;//Press the key for 1 seconds to reboot and enter the firmware upgrade}Else{Keycount=0; } //Reload Timertasks[1].td=5; } //task three, pseudo t
, there isNo-to-kill Su Lu's component. Put a black chess x can surround white o, only a black chessMethod Search White There are a few blank points around if it's less than or equal to 1.#include #include#include#include#include#include#includeusing namespacestd;#defineN 200#defineMet (A, b) memset (A,b,sizeof (a));Vectorint> >Q;CharStr[n][n];intdis[4][2]= {{0,1},{1,0},{-1,0},{0,-1}};intVis[n][n];intPanintXinty) { return(x>=0 x9 y>=0 y9);}intDfsintXinty) {vis[x][y]=1;intf=0; for(intI=0; i4;
true and false with integers 0 or 0, which differs from the C language. //b1 = 0;Boolean data only allows values of true and false, and cannot replace true and false with integers of 0 or not 0, which differs from C language.basic data type conversionsAutomatic type conversions: small-capacity types are automatically converted to large-capacity data types. The data types are sorted by capacity size:When there are multiple types of data blending operations, the system first automatically conver
JS provides a number of properties to describe the window size, but in different browsers, there are some differences in detail, this article is used to record these easy to forget the small detailsonly chrome,firefox,ie8,9,10,11 (simulation mode using IE11) is currently testedStandard mode PC-side screen size 1920*1080 full screen browser Test format width/height
Browser/Properties
Inner
Documentelement.client
Body.client
i8
undefined/undefined
blank lattice is ‘.‘ represented by.A Sudoku.The answer is marked red.Note:
The given Sudoku sequence contains only numbers 1-9 and characters ‘.‘ .
You can assume that a given Sudoku has only one solution.
The given Sudoku is always 9x9 the form.
Idea: Search for the title, in the position can fill a number, and then judge the legitimacy, if the legal from the state and then fill the next number.Originally thought to use a A *, the results found that the direct search als
number of times when sorting9 {Ten for(intj=0; j8-I.; J + +)//control the subscript for each trip sort One { A if(arry[j]1]) - { -TEM =Arry[j]; theARRY[J] = arry[j+1]; -arry[j+1] =tem; - } - } + } - +printf"array elements are arranged from large to small: \ n"); A for(intI=0; i9; i++) at { -printf"%d\n", Arry[i]); - } - return 0; -}2. Select sort1#include 2 3 intMa
• Title: Enter positive integer n to output all expressions, such as abcde/fghij=n, in order from small to large, where a~j happens to be an arrangement of the digital 0~9, 21#include 2 3 intMain ()4 {5 intN,x,y,temp;//a[10]={0};6 intI,j,flag;7scanf"%d",n);8 for(x=12345; x98765; x + +)9 {Ten inta[Ten]={0}; OneFlag =1; Atemp =x; - - //if (x%n! = 0)//do not use this sentence array A to re-initialize all! the //continue; - - if(x%n==0)//record
; // forced type conversion format: Target type target property = (target type) original type; int i8 = (int) d5; // convert the double type to an integer. int i9 = (int) d6; int i10 = (int) d7; System. out. println (i8); System. out. println (i9); System. out. println (i10); Object obj; String str = "100"; // Add the value of str to 100 inti11 = Integer. parseInt (str); // convert the string to our int typ
the array is usually used.An array cannot participate in an operation, only a single element.Second, array sortingBubble Sort:1 //randomly outputs 0-30 of the number and sorts from small to large2#import 3 4 intMainintargcConst Char*argv[])5 {6 7 intnum1[Ten]={0};8 for(inti =0; iTen; i++) {9Num1[i]=arc4random ()% to;Tenprintf"%d", Num1[i]); One A}printf ("\ n"); - for(inti =0; i9; i++) { - for(intj =0; j9-I.; J + +
Blue Bridge practice field constantly encountered similar problems, are a recursive search routines. Algorithm to increase the number of permutations time limit: 1.0s memory limit: 256.0MBProblem description 0, 1, 23 digits of the full array of six, according to alphabetical order as follows:012, 021, 102, 120, 201, 210Enter a number n0~9 the nth (1th 0123456789) in the full array of 10 numbers.An input format line containing an integer n output format row containing a set of 10 numbers of the f
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.