2016.7.12 NOIP2013 Improve group Day2 Problem Solving report (unfinished version)

Source: Internet
Author: User

Exam non-stop, yesterday's procedure has not changed, today, and Day2, although not yesterday, but not so confused, but still not satisfactory, and now did not talk about the problem, I intend to read a problem report, to deepen understanding, after all, a predecessor said, do a set of quality depends on the quality of the question itself and the extent of your thinking.

Exam Summary:

1. Data analysis speculated that the feasible algorithm is very important, to grasp the time complexity of common algorithms flexibly;

2. Be proficient in the way you shoot, and spend too much time on the PAT.

3. To strengthen the ability of code implementation, the more outstanding performance is the ability to write 200-300-line multi-function simulation or search;

4. Do not rush to write an endless program, to take a little more time to analyze the data, the sample is not enough to self-out (otherwise it will be as today as finished writing nothing to do;

5. Do not have the fear mood, the examination is the most important is thinking rather than the score, as long as the time spent enough to think, even if the last did not achieve, the obtained is far more than the direct write violence algorithm, now practice the most important or thinking, and seemingly difficult problems also have a lot of people do it, so certainly don't be afraid;

6. To gradually adapt to high-intensity long-time thinking, of course, if it is very tired or can go downstairs to buy two series of Oden Cook xxx;

Resources:

1. References for yesterday 2;

2. The teacher provides the problem solving report 3, from Dovecl

A. Building Block contest

Test instructions: N is the width, h is the request height, asks each layer of the Unicom block;n<=100000;h<=10000; (test instructions Understanding how important is here to be seen: my understanding let me confine the outer loop maxnh, However, the understanding of reference 2 opens up another algorithm: How to make an empty sequence a sequence;

Problem analysis: Just get this problem, Maxnh*n algorithm will float now our mind, and then, some more cautious people (after all, although the evaluation machine theory speed can reach 1e9, but due to the existence of sub-operation, usually even a very ' clean ' 1e8 of the program evaluation when we will be scared) will find that A maximum of 1e9 of the calculation may be more than the time, and indeed it is really over the last group, so it is necessary to adopt a smarter approach;

And then! Something magical happened! I actually gave the inner layer to use the Division (manual Laughter Cry), and then tried to make it more complicated (manual goodbye), the only consolation is this exercise a bit of my thinking ability Orz, I think this division is very ingenious, so by the way posted up:

#include <cstdio>#include<iostream>#include<cmath>#include<cstdlib>#include<cstring>#include<string>#include<algorithm>#include<queue>#include<Set>using namespacestd;intn,h[100005],ANS,MAXN;voidResintLefintrig) {    if(lef>=rig-1)    {        if(h[lef]>=1|| h[rig]>=1) ans++; H[lef]--; if(lef!=rig) H[rig]--; return; }    intMid= (Lef+rig)/2; Res (LEF,MID); Res (Mid+1, Rig); if(h[mid]>=0&&h[mid+1]>=0) ans--;}intMain () {Freopen ("block.in","R", stdin); Freopen ("Block.out","W", stdout); Ios::sync_with_stdio (false); CIN>>N;  for(intI=1; i<=n;i++) {cin>>h[i];maxn=Max (maxn,h[i]); }     for(intI=1; i<=maxn;i++) {res (1, N); } cout<<ans; return 0;}

Then the problem of the positive solution should be a differential sequence the fastest, and then also have classmates with the sub-module recursion (with other data structure should be nlogn around, here also tell us a truth: data structure is the basis, algorithm is the method, data structure must not underestimate, to be flexible to master its foundation on the operation! )

Because the difference sequence is classic (this is a relatively classical mathematical thinking, yesterday's match is also), so changed the program of difference (it is not because this is relatively simple QWQQQ

Two. Gardener

Test instructions: N flower number, h height, sine function (false), to find the wave sequence

Analysis of the problem, the preliminary analysis of the problem I have to write a search + optimization (over three groups),

2016.7.12 NOIP2013 Improve group Day2 Problem Solving report (unfinished version)

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.