0_0_13806199_21969.cpp:1:9: error: #include expects "FILENAME" or <FILENAME>
#include#include#include#includeusing namespace std;typedef set::iterator it;const int N = 10000;int dis[N], tdis[N], link[N][12];queue q;set zone;void bfs(int o){ memset(tdis, 0, sizeof(tdis)); tdis[o] = 1; q.push(o); while(!q.empty()) { int cur = q.front(); q.pop(); if(tdis[cur] > dis[cur]) dis[cur] = tdis[cur]; for(int i = 1; i <= link[cur][0]; ++i) { int j = link[cur][i]; if(tdis[j] == 0) q.push(j), tdis[j] = tdis[cur] + 1; } }}int main(){ int cas, nz, nr, id, mz, mr, ans, t; scanf("%d", &cas); while(cas--) { zone.clear(); memset(dis, 0, sizeof(dis)); scanf("%d%d", &nz, &nr); for(int i = 1; i <= nz; ++i) { scanf("%d %d", &id, &mz); link[id][0] = mz; zone.insert(id); for(int i = 1; i <= mz; ++i) scanf("%d", &link[id][i]); } for(int i = 1; i <= nr; ++i) { scanf("%d", &mr); for(int j = 1; j <= mr; ++j) { scanf("%d", &t); bfs(t); } } it i = zone.begin(); ans = *i; for(++i; i != zone.end(); ++i) if(dis[*i] < dis[ans]) ans = *i; printf("%d %dn", dis[ans], ans); } return 0;}
^
|