Offline Game summary

Recently because of the league approaches, the exam also become offline by racing online game.

Because too few off-line test match, resulting in the unnecessary mistakes.

First to sum up some of the details wrong.

  1. Side array adjacency list is not open twice.
  2. I did not see the open data lead to an array of small.
  3. An array of small high-precision opening.
  4. A wide search found a little direction.
  5. Debugging code is not closed.

For these errors, do not shoot well is shoot out, but just a little check can be seen.

to sum up:

Exam left double-check when ten minutes! ! !

For debugging Another way is to use \ (cerr \) , usage and \ (cout \) the same.

This function will only display in black frame runtime, that is, if you forget to turn off all right, but time-consuming will increase a lot.


Next is some \ (windows \) under environmental \ (CE \) error.

\ (CE \) is very terrible, this will lead to a significant decline in our scores, so we have to avoid this situation.

  1. Did not increase when overloaded operators \ (const \) or &.
  2. Plus function \ (inline \) did not increase the return type.
  3. System variable names and function names conflict.

to sum up:

For these cases we must look carefully, otherwise cool.


Then there is some other problem.

Such as memory overrun problem is also critical.

For the students can not be calculated using the following method:

#include<bits/stdc++.h>
using namespace std;

bool Mop1;

int n,m;// 把要开的东西放在两个bool里面。

bool Mop2

int main(){
    printf("M=%lfmb",(&Mo2p-&Mop1)/1024.0/1024.0);
}

Output look on the line.

There is a must to shoot

He avoided a lot of low-level errors.


When the offline test match, must pay attention to segmentation .

Slicing code can be placed inside the structure, or \ (namespcae \) , the same variable name can be prevented.

#include<bits/stdc++.h>
using namespace std;

int n,m;

struct T170{
    inline void solve(){
        //代码....
    }
}P70;

struct T1100{
    inline void solve(){
        //代码...
    }
}P100;


int main(){
    cin>>n;
    if(n<10)P70.solve();
    else P100.solve();
}

For different data ranges to play different code.

This prevents positive solutions linked to knock, to keep a certain score.

For a question, do not immediately knock sure to think it over and then knock .

The more thought, playing less.

Guess you like

Origin www.cnblogs.com/dsjkafdsaf/p/11282476.html