Use the FIFO, OPT, and LRU replacement algorithms to simulate the page replacement process. (For Linux and Windows)Input: 3 // page Frames
7 0 1 2 0 3 0 4 2 3 0 3 2 1 2 0 1 7 0 1 // pending pageOutput: Changes of frames and the number of page errors
CD operationTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission (s): 325 Accepted Submission (s): 90
Problem DescriptionIn Windows, we can use cmd to run some DOS functions. CD is an interesting
Analysis:
This is between 1000-10000, from one prime number to another. We will think of printing the prime number table first and then searching.
In addition, we should transform the prime number. Use queue for storage.
The Code is as follows:
[Cpp]
EightTime Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission (s): 8747 Accepted Submission (s): 2387Special Judge
Problem DescriptionThe 15-puzzle has been around for over 100 years; even if you don't know
Atomic, spinlock and mutex Performance ComparisonI am very curious about the performance of different synchronization principles, so I made the following experiments to compare atomic, spinlock, and mutex:1. No Synchronization# Include # Include
[Html]# Include Using namespace std;Const int _ max = 121;// C1 is the number of quality weights that can be combined.// C2 indicates the intermediate quantity, which is not saved once.Int c1 [_ max], c2 [_ max];Int main (){// Int n, I, j, k;Int
I. assert is a macro
Specifically: in C, ASSERT is a macro rather than a function.Assert () is a macro that is often used when debugging programs. When the program is running, it calculates the expressions in parentheses.
If the expression is FALSE (
[Cpp]# Include # Include # Include # Include # Include Using namespace std;Const int oo = 1000000; Int main (){Map mymap;Int t, l, n, co, a, B, ca = 0;Map :: iterator it1, it2;Scanf ("% d", & t );While (t --){Mymap. clear ();Mymap [oo] = 1,
Recently, it's a little decadent. It's not good to take a rest every day. I'm really not in the status of CF. I haven't written a question for a long time, so I wrote a question about water to remove the grass.
Every day, I was scared by the various
Because there is an exercise in The book that requires fast sorting, I have reviewed it and shared it with others.
The core of quick sorting is a divide and conquer algorithm. Unfortunately, the Chinese books we have come into contact with
Print? // Calculate the number of 1.cpp: Defines the entry point for the console application.// # Include "stdafx. h"# Include Int func (int num){Int countx = 0;While (num){Countx ++;Num = num & (num-1 );}Return countx;}Int _ tmain (int argc, _
68. Arrange the array into the smallest number.Question: enter an array of Positive Integers to join them into a number and output the smallest of all the numbers that can be discharged.For example, if the input array is {32,321}, the minimum
[Cpp] view plaincopyprint? // A two-way linked list in which the binary search tree is converted to an ordered table. cpp: Defines the entry point for the console application.//// Question: Convert the binary search tree into a sorted two-way linked
The first topcoder, I used to feel that I was not qualified to do tc, cf or something, and now I am gradually getting in touch with it.
I think it's okay, but there are still questions that make us comfort with the dishes.
Tc is really fun. There
TravellingTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission (s): 2520 Accepted Submission (s): 735
Problem DescriptionAfter coding so many days, Mr Acmer wants to have a good rest. So traveling is the
Can we quickly find two numbers in an array so that the sum of these two numbers is equal to a given value? To simplify the process, we assume that there must be at least one set of compliant solutions in this array.
Method 1:
The most direct method
Good Luck in CET-4 Everybody!Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission (s): 3552 Accepted Submission (s): 2232
Problem DescriptionThe CET-4 is coming soon. Are you busy reviewing? Maybe even
# Include # include # include using namespace std; int c [5005]; int a [5005]; int ans, n; int lowbit (int x) {return x & (-x);} int Sum (int end) {int sum = 0; while (end> 0) {sum + = c [end]; end = end-lowbit (end);} return sum;} void change
Question: Give you two strings s1 and s2. Ask you to find a substring t with the maximum length. t is the prefix of s1 and is the suffix of s2. The length of t and t is output, if it does not exist, 0 is output directly.
1. directly request next
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