Idea: greedy. Try to add large numbers first. Consider the case of leading zero.
Code:
#include
#include
const int N = 1000005;int t, v1[10], v2[10], ans[N];char s1[N], s2[N];void solve() { int n = strlen(s1); if (n == 1) {ans[0
# Include "head_file.h" # include
# Include
Int main () {timeb t1, t2; // defines two variables: long t; double x, sum = 0, sum1 = 1; int I, j, n; printf ("Enter x n:"); scanf ("% lf % d", & x, & n); ftime (& t1 ); // record start time
Some time has not been updated. I spent a few days paying attention to it. After a dozen times, I decided to finish the first season, and then analyzed it again according to my understanding, the second time should be classified by problem. The
I am a funny girl... It's really not about algorithms.
For a group backpack that is not quite satisfactory, select at least one item for the group. Dp [I] [j] can be updated by the current dp [I-1] [j-c] and dp [I] [j-c.
#include
#include
Link: hdu 4722 Good Numbers
Give a, B, and ask how many good numbers are between a and B. The definition of a good number is that the number of each digit is a multiple of 10.
Solution: dp [I] [j] indicates the I-th bit, and the sum of the former
Problem DescriptionYou are given a sequence of n integers a1, a2 ,..., an in non-decreasing order. in addition to that, you are given several queries consisting of indices I and j (1 ≤ I ≤ j ≤ n ). for each query, determine the most frequent value
Link to the question: 1543-telease: in order to give some vertices on the circumference, select some vertices to form the maximum m-side area. Idea: dp, dp [I] [j] [k] indicates that the first vertex is I, the last vertex is j, and the maximum value
Link to the question: Ultraviolet A 12105-Bigger is Better
There are n matches, and a number can be divided by m, and the maximum.
Solution: dp [I] [j] indicates that I match is used to form a number that modulo m and j, but the State retains a
Small yuan in hard time limit: 1000 MS | memory limit: 65535 KB difficulty: 2
Description
In multimedia data processing, data compression algorithms are particularly important. After class, xiaoyuan wanted to invent a data compression
The questions are as follows:
''Accored'' Patience
You are to simulate the playing of games of ''accored'', the rules for which are as follows:
Deal cards one by one in a row from left to right, not overlapping. Whenever the card matches its
This question was done last night. I didn't come up with a good idea when I first started reading the question. Then I checked the question D. I found it was a suffix array, then I changed the template and handed it in ...... Unfortunately ...... WA,
Link to the question: Ultraviolet A 1371-Period
Returns two strings A and B. Splits B into several substrings, and each substring is converted to string, the maximum number of edits for all substrings is the maximum number of edits in the current
Use a geometric template to find the outer circle, and then judge that the point is not in the circle.
# Include
# Include
# Include
Const double esp = 1e-9; // Point struct Point {double x, y; Point () {} Point (double x,
N numbers Nnum [I] indicates that only the number of Nnum [I] can be obtained at a time.
M questions: each time I give you a heap of stones, each Heap has a num stone and asks if the first hand will win.
Sample Input
2 2 532 5 123 2 4 74 2 3 7 125 1
Monotonous queue entry question...
Dp [I] [j]: the maximum profit obtained when j shares are held on the I day.
If the day I does not buy do not sell: dp [I] [j] = max (dp [I] [j], dp [I-1] [j]);
If the day I buy: dp [I] [j] = max (dp [I] [j], dp [i-
PS: strongly connected and scaled down. Be sure not to forget that the graph is strongly connected. WA is performed four times. Warm-up for the provincial competition.
#include
#include
#include #include
#include
Bare Splay flip + cut and paste
Play with Chain
Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission (s): 3397 Accepted Submission (s): 1408
Problem DescriptionYaoYao is fond of playing his chains. He has
Problem of IP time limit: 1000 MS | memory limit: 65535 KB difficulty: 2
Description
As we all know, computers can only recognize binary data, but we are used to decimal. So people invented the dot decimal to represent IP addresses. The
After a long and successful day of preparing food for the banquet, it is time to clean up. there is a list of n jobs to do before the kitchen can be closed for the night. these jobs are indexed from 1 to n.
Most of the cooks have already left and
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