[c]#include <stdio.h>

#include <string.h>

#include <stdlib.h>

#define min(a, b) (a < b) ? a : b

#define MAXV 105

#define MAXE 5100

int adj[MAXV][MAXV], dfn[MAXV], L[MAXV], num, n;

int edges[MAXE][2], e;

char ara[MAXV][35];

int get_indx(char s[])

{

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

if(!strcmp(ara

*, s))*

return i;

return 0;

}

void art(int u, int v)

{

int w;

dfn = num;

L = num;

num++;

for(w=1; w<=n; w++)

{

if(adj[w])

{

if(!dfn[w])

{

edges[e][0] = u;

edges[e++][1] = w;

art(w, u);

L = min(L, L[w]);

}

else if(w!=v)

L = min(L, dfn[w]);

}

}

}

int comp(const void *a, const void *b)

{

char *x = (char *)a;

char *y = (char *)b;

return strcmp(x, y);

}

void main()

{

char a[35], b[35], ans[MAXV][35];

int points[MAXV];

int i, j, count, u, v, root, r_count, map=0, m;

while(1==scanf("%d", &n) && n)

{

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

{

for(j=1; j<=n; j++) adj

return i;

return 0;

}

void art(int u, int v)

{

int w;

dfn = num;

L = num;

num++;

for(w=1; w<=n; w++)

{

if(adj[w])

{

if(!dfn[w])

{

edges[e][0] = u;

edges[e++][1] = w;

art(w, u);

L = min(L, L[w]);

}

else if(w!=v)

L = min(L, dfn[w]);

}

}

}

int comp(const void *a, const void *b)

{

char *x = (char *)a;

char *y = (char *)b;

return strcmp(x, y);

}

void main()

{

char a[35], b[35], ans[MAXV][35];

int points[MAXV];

int i, j, count, u, v, root, r_count, map=0, m;

while(1==scanf("%d", &n) && n)

{

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

{

for(j=1; j<=n; j++) adj

*[j] = 0;*

dfndfn

*= 0;*

}

for(i=1; i<=n; i++) scanf("%s", ara}

for(i=1; i<=n; i++) scanf("%s", ara

*);*

scanf("%d", &m);

while(m--)

{

scanf("%s%s", a, b);

i = get_indx(a);

j = get_indx(b);

adjscanf("%d", &m);

while(m--)

{

scanf("%s%s", a, b);

i = get_indx(a);

j = get_indx(b);

adj

*[j] = adj[j]**= 1;*

}

e = 0;

num = 1;

art(1, 0);

for(i=1; i<=n; i++) points}

e = 0;

num = 1;

art(1, 0);

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

*= 0;*

root = 1;

r_count = 0;

count = 0;

for(i=0; i<e; i++)

{

u = edgesroot = 1;

r_count = 0;

count = 0;

for(i=0; i<e; i++)

{

u = edges

*[0];*

if(u==root)

{

r_count++;

continue;

}

if(points) continue;

v = edgesif(u==root)

{

r_count++;

continue;

}

if(points) continue;

v = edges

*[1];*

if( L[v] >= dfn)

{

count++;

points = 1;

}

}

if(r_count > 1)

{

count++;

points[root] = 1;

}

if(map) printf("\n");

printf("City map #%d: %d camera(s) found\n", ++map, count);

for(i=1, j=0; i<=n; i++)

if(pointsif( L[v] >= dfn)

{

count++;

points = 1;

}

}

if(r_count > 1)

{

count++;

points[root] = 1;

}

if(map) printf("\n");

printf("City map #%d: %d camera(s) found\n", ++map, count);

for(i=1, j=0; i<=n; i++)

if(points

*)*

strcpy(ans[j++], ara[i]);

qsort((void *)ans, j, sizeof(ans[0]), comp);

for(i=0; i<count; i++) printf("%s\n", ans[i]);

}

}[/c]

( I have got 315 AC with almost same code )strcpy(ans[j++], ara[i]);

qsort((void *)ans, j, sizeof(ans[0]), comp);

for(i=0; i<count; i++) printf("%s\n", ans[i]);

}

}[/c]

( I have got 315 AC with almost same code )