51nod 1244 The sum of the function of the MO
link to original topic
the https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1244 topic is to let you calculate the Metos function. Classic du sieve u∗i=e u*i=e m (n) =1−∑i=2nm (⌊ni⌋) m (n) =1-\sum_{i=2}^nm (\big\lfloor\frac{n}{i}\big\rfloor)
#include
The sum of the functions of the MO-colorimetric
Base time limit: 3 seconds Space limit: 131072 KB Score: 320 Difficulty: 7-level algorithm problemhttp://www.51nod.com/onlineJudge/questionCode.html#!problemId=1244
Möbius function, presented by German mathematician and astronomer Möbius. Mertens (Mertens) first uses μ (n) (Miu (n)) as the token of the Möbius function. It is defined as follows:If a number contains a square factor, then Miu (n) = 0. For
1. In desktop mode, right-click the IE icon in the lower left corner.2. Right-click Internet Explorer ].3. Select run as administrator ].4. In the User Account Control window, click yes ]. (Skip this step if this window is not displayed)5. Click the gear icon in the upper-right corner.6. Select Internet options ].7. Select advanced ].8. Click Reset ].9. In the new window, click Reset ].10. Click close ].Aft
In development, we will use a lot of forms, we want to submit the form after the reset,
But jquery does not have this method, how to deal with it?
Copy Code code as follows:
Method One:
We can do this by just realizing
Id:
Copy Code code as follows:
document.getElementById ("Form1"). Reset ();
Name
Copy Code code as follows:
Document.formName.res
In development, we will use a lot of forms, we want to submit the form after the reset,
But jquery does not have this method, how to deal with it.
Method One:
We can do this by just realizing
Id:
document.getElementById ("Form1"). Reset ();
Name
Document.formName.reset ();
Method Two:
Empty each:
$ ("#inp"). Val ("1");
But the form is too many words, this is also impractical, there are 100, 1000,
In form registration or login code, the reset button appears frequently. In the general impression, you can click the reset button to set the value of the form element to null, I think this is the initial impression of many beginners on this button, but it is hard to say whether it is the actual nature.
Let's take a look at a code example:
In the above Code, if you click the
We hope that after the form is submitted, we can reset it. Because jquery does not have this method, we can only use other methods for implementation. For details, refer, I hope it will be helpful to everyone. In development, we will use many forms. We hope that after the form is submitted, we can reset,
But jquery does not have this method. How can this problem be solved?
The Code is as follows:
Meth
1. Use an image instead of the submit button submit and reset button reset to add an onclick event to the image.
Name:
2. Add a style to the image in step 1 to compensate for the problem. 1. Move the mouse over the image without any response and fail to give the customer a good browsing experience.
Name:
3. Use an image instead of the submit button submit and
Recently has been doing a variety of pages, "Add and change", but in doing new features, they have been usingReset to clear the form form, the original thought that the method is foolproof, but eventually in the "modified" operation after the "new" time, will be error, so their solution is in the use of new methods, the hidden domain passed the id deleted, This will not be in the process of running an error. Just today, our boss happened to tell us: the new emptying of the form when the use of
Generally, this command automatically determines the type of the current terminal from the environment variable, command column, or other configuration files. If the specified type is '? ', This program requires the user to enter the terminal type.Because this program will set the terminal machine back to the original state, in addition to being used in login, when the system terminal enters some strange state due to abnormal program execution, you can also use it to
in the group today, I see someone asking SQL Server self-value-added reset issue (SQL identiy column value reset)Gossip less, directly on the code:Body:--create table--Create test Tableif not exists(Select * fromsysobjectswhereName= 'test_1') begin Create TableTest_1 (IDint Identity(1,1)Primary Key, Namenvarchar( -), CreateDatedatetime); EndElse begin Drop Tabletest_1; Create TableTes
Http://www.it165.net/database/html/201208/2801.html
Sometimes you want to clear all replication information from the library, such as switching to a different master, master-slave redo, and so on; the reset slave is a dangerous command, so be sure to be prepared to know what it means before you execute it.1. The command is executed on the slave and must be stopped before execution slave (stop slave)2. After you perform
, 2]: color 2 flower only one flower , the princess does not pick; Inquiry [2, 3]: Because the color 2 flower has two flowers, the princess picked the color 2 flower; Inquire [3, 5]: Color 1, 2, 3 flowers each, the princess does not pick. Prompted"Data Range"For 100% of data, 1≤n≤10^6,c≤n,m≤10^6.The topic of my first MO team algorithm.Note that the block of the MO team algorithm is 1~n (the range of inqu
With the Modified Mo team algorithm and the modified team AlgorithmPre
I learned about the queue algorithm a long time ago.
When the teacher gave a lecture, he mentioned that the online offline ...... However, I have never done any relevant questions,
Today, we have the honor to have a naked question about how to modify the mo team,
Let's share our experience.
Teams with modifications
First of all, we need
100% of data, n≤10000,m≤10000, no more than 1000 modifications, all the integers appearing in the input data are greater than or equal to 1 and no more than 10^6.2016.3.2 new data and two groups by Nano_ape
Resources:
1.http://blog.csdn.net/a_crazy_czy/article/details/51544720
2.http://blog.csdn.net/werkeytom_ftd/article/details/51540342
Block of sequencesFor the query operation, the block with the left boundary is the first keyword, the block of the right border is
number of a[i]^k, and update the answer on the LINE. The above is a different or processing part. Next is the MO team Algorithm. The MO team algorithm is a brute force algorithm used to solve interval problems. His principle is that if I know the value of [l,r], I can find the values of [l+/-1,r] and [l,r+/-1] at O1 time, then the values of query [l+/-k,r] and [l,r+/-k] need K-step. If we were to query mul
represents the size of the data that is numbered I.The third line is a positive integer q, indicating that Mato will look at the data for a few days.After the Q line of two positive integers per line L, R, indicating Mato this day to see the [l,r] interval of the file.OutputQ lines, one positive integer per line, indicating the number of times the Mato need to be exchanged this day.Sample input41 4 2 321 22 4Sample output02ExercisesDiscretization + MO
Title Link: Http://codeforces.com/problemset/problem/617/ETitle:Here you A1 A2 A3 An number, M inquiry: in [L, R] inside how much [L, R] makes Al xor al+1 xor AR is k.The following:in the subject only interval query has no interval modification, and the amount of data is small (10w ), so it can be solved in an offline way. Using the MO team algorithm to solve, you need O (1) Modification [L, r+1], [L, R-1], [L+1, R], [L-1, R].Detailed
Title Link: http://acm.hdu.edu.cn/showproblem.php?pid=6333Tips for solving problems:
This problem can be said to be very wonderful, first push combinatorial mathematical formula, one of the most important formula is CNm = Cmn-1 + Cm-1n-1 This formula know Yang Hui Triangle is understood, but a look found nothing to use. However, the formula can be used as a basis for further deduction.
Set snm = cn1 + CN2 + CN3 + ... CnM then continue using the basic formula above can be converted into
"Algorithm One"Violence.Can pass the No. 0,1 test point. Estimated score: a score of. "Algorithm Two"Classic question: Interval number, data range is not very large, so we can:① block, discretization, preprocessing: The number of x occurrences in the i block ( differential );I to block J is who, how many times have appeared. When asked, the answer to the whole block is directly answered; for scattered parts, the number of occurrences of each number of violent statistics, coupled with the result
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.