码 风 moment

Note: When the card is often how fast how to QwQ

Use scanf printf, do not read fast.

Sometimes #define int long long.

Never macro definition special number.

The opening brace must want to change the line.

main function written in the last.

Use STL. Sometimes manually open optimization.

Do not use bit operation.

When the inner loop or a judge sentences a statement only, do not write parentheses, not wrapped.

use

for(int i=1;i<=n;i++)

or

for(int i=0;i<ss.length();i++)//与STL有关的用这种写法

Do not use

for(int i=0;i<n;i++)//与STL有关的除外

or

for(int i=1;i<=n;++i)

or

int i;
for(i=1;i<=n;i++)

Define global variables like, a lot of time in order to prevent the same name, the use of ss, s1, s2, xx, yy, dx, dy, sx, sy, tx, ty, now, nxt, qwq, qaq.
Loop variables i, j, k, l.
if multiple sets of test data, with

for(int qwerty=1;qwerty<=tests;qwerty++)

Without

while(tests--)

General use i ++, rather than ++ i, in addition to

a [++ cnt] = i;
this statement.

Guess you like

Origin www.cnblogs.com/pjykk/p/11226433.html