【发布时间】:2013-02-02 16:29:18
【问题描述】:
是否存在任何 cpp 代码解析器来解决此问题?例如
// B.cpp : Defines the entry point for the console application.
//
#include<iostream>
#include<vector>
#include<algorithm>
size_t N,M;
const size_t MAXN = 40000;
std::vector<std::pair<size_t,size_t> > graph[MAXN],query[MAXN],qr;
size_t p[MAXN], ancestor[MAXN];
bool u[MAXN];
size_t ansv[MAXN];
size_t cost[MAXN];
size_t find_set(size_t x){
return x == p[x] ? x : p[x] = find_set(p[x]);
}
void unite(size_t a, size_t b, size_t new_ancestor){
}
void dfs(size_t v,size_t ct){
}
int main(int argc, char* argv[]){
return 0;
}
这个文件有 10 个全局变量:ancestor、ansv、cost、graph、M 、N、p、qr、查询、u
【问题讨论】:
-
叹息...你试过什么?
-
为什么需要它?而全局变量并不是一个明确的定义,因为全局变量可能通过
#include指令引入,宏可能会影响声明。