PetTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission (s): 535 Accepted Submission (s): 258 Problem DescriptionOne day, lin Ji wake up in the morning and found that his pethamster escaped. he searched
C ++ code:
# Include # include const int maxsize = 10000000; char s [maxsize], ans [maxsize]; int main () {char c; long B, a; memset (s, 0, maxsize); while (scanf ("% s % c % lld", s, & c, & B )! = EOF) {memset (ans, 0, maxsize); int I; a = 0;
Question Description: Xiao Ming always tends to ignore the carry when he does decimal addition with paper and pencer. for example, 15 + 17, Xiao Ming will answer 22, because he ignores the carry from the single digits.5 + 7 = 12, and the digit 1 is
1. CStringArray class
The CStringArray class can be used to store CString objects, and its capacity can be dynamically increased.
CStringArray
CObject └ CStringArray
The CStringArray class supports arrays of CString objects.The member functions of
Problem DescriptionThe International Clown and Pierrot Competition (ICPC), is one of the most distinguished and also the most popular events on earth in the show business.One of the unique features of this contest is the great number of judges that
1. recursive call method to implement reverse output of the unsigned number
C language implementation (DEV c ++ 4.9.9.2 run through)[Cpp]# Include Void reverse_print (unsigned long num){If (num = 0)Return;Printf ("% d", num % 10); // outputs the
I. Pre-and Post-order Recursion[Cpp]/*The Recursive Implementation of the pre-and post-order is the simplest to understand. The main point is the location of visit (node.*//*Pre-and post-order recursion implementation*/// Pre-order traversalVoid
I. overload of C ++ member functions
There are four types of member functions in C ++: common member functions, virtual functions, and const member functions.
(1) void func (int );
(2) virtual void func (int );
(3) void func (int a) const;
If you
Problem DescriptionTo Chinese people, 8 is a lucky number. Now your task is to judge if a number is lucky.We say a number is lucky if it's a multiple of 8, or the sum of digits that make up the number is a multiple of 8, or the sum of every digit's
The following is my summary when I changed ST's Custom_HID routine to a "Custom USB device" routine, because I just learned about USB development, and some understanding errors are inevitable, please correct me.
1. usb_desc.c File
Modify according
Black and white coloring and then finding the maximum matching of the Bipartite Graph [cpp]# Include # Include # Include Using namespace std;Const int maxn = 40 + 9;Int n, m;Char a [maxn] [maxn];Struct{Int to, next;} E [maxn * 10*4];Int head [maxn *
Question:
Give N sides and make them into a triangle. What is the maximum area? All edges must be used.
Ideas:
For triangles with known perimeter, a third edge can be introduced as long as we know the length of the two sides, so we can get the
Linked List IntersectionThe head pointers of two one-way linked lists, such as h1 and h2, are given to determine whether the two linked lists are intersecting.
Solution:1. first determine whether the linked list has a ring2. If there is no ring,
Concept:Connection: in an execution program, the identifier represents the bucket that stores variables or compiled function bodies. The connection describes the bucket in what the linker sees. There are two Connection Methods: internal link and
At that time, a GSL log1p (x) code implementation was provided. However, I didn't want to understand why it was like that. I suddenly understood it when I read a post on shuimu recently.
The Code on GSL is as follows:
[Cpp] view plaincopyprint?
When I first started to use the method of repeatedly reading the question, I had timed out and did not know how to cut the question. I searched other people's solutions online, most of which were BFS (it seems that this question BFS is simpler,
Reverse a linked list from position m to n. Do it in-place and in one-pass.
For example:Given 1-> 2-> 3-> 4-> 5-> NULL, m = 2 and n = 4,
Return 1-> 4-> 3-> 2-> 5-> NULL.
Note:Given m, n satisfy the following condition:1? M? N? Length of list.
/** *
In a undirected connected graph, find a ring with the largest number of passing edges. Solution: Direct DFS from any point without backtracking. Note that there are at least three sides in the ring. Any one of the largest loops can be found.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service