テンプレート - テンプレートCodeforces

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

const int MAXN = 2e5;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;

int qpow(ll x, ll n) {
    ll res = 0;
    while(n) {
        if(n & 1)
            res = res * x % MOD;
        x = x * x % MOD;
        n >>= 1;
    }
    return res;
}

int a[MAXN + 5];

void test_case() {
}

int main() {
#ifdef KisekiPurin
    freopen("KisekiPurin.in", "r", stdin);
#endif // KisekiPurin
    int t = 1;
    //scanf("%d", &t);
    for(int ti = 1; ti <= t; ++ti) {
        //printf("Case #%d: ", ti);
        test_case();
    }
}

/*
    1. 小数据问题退化:
        输入为0或1会不会有特殊情况?其他的比如最小环要有三个点,强连通分量缩到最后一个点等等。
    2. 内存:
        内存的空间有没有开够?有时有反向边,有时有额外新加的边。线段树开了4倍了吗?
        可持久化数据结构会不会内存溢出?多组数据时vector会不会翻车?字符大小写有考虑吗?
        多组数据有进行初始化吗?memset会不会翻车?
    3. 算术溢出:
        乘法上溢出了?忘记取模了?输入输出用了%d?让无符号数越到负数了?
    4. 习惯:
        函数都有指定返回值吗?返回值非void函数的每一个分支都有显式的返回值吗?确定不会进入的分支可以assert一把。
        Yes和No有没有反,大小写有没有错?有没有搞错n和m?离散化之后的cn有没有错?换行和空格要怎么整?priority要把符号反过来。
    5. 其他bug:
        基环树是树加环,不是链加环。
*/

おすすめ

転載: www.cnblogs.com/KisekiPurin2019/p/11992540.html