/* ACM Western European Region, 1994-95 Problem A, Presentation Error Ed Karrels, October 1996 */ #include #include #include void uc(char *str) { while (*str) { if (islower(*str)) *str = toupper(*str); str++; } } void rws(char *str) { char *r, *w; w = str + strlen(str) - 1; while (isspace(*w)) { *w = 0; w--; } r = w = str; while (isspace(*r)) r++; while (*r) *w++ = *r++; *w = 0; } int mycmp(char *s1, char *s2) { while (*s1 && *s2) { if (*s1 == '[' || *s1 == ']') { s1++; } else { if (*s1 != *s2) return 0; s1++; s2++; } } while (*s1 =='[' || *s1 == ']') s1++; return (!*s1 && !*s2) ? 1 : 0; } int Ok(char *s1, char *s2) { int len, ls2, i; char *ess; while (*s1 && *s1 != '[') s1++; if (!*s1) return 1; len = 0; ess = ++s1; while (*s1 != ']') {s1++; len++;} ls2 = strlen(s2); for (i=0; i<=ls2-len; i++) { if (!strncmp(ess, s2+i, len)) { if (Ok(ess+len+1, s2+i+len)) return 1; } } return 0; } int main() { int nc, cn, jl, sl, i, acc; char jury[10][100], submit[10][100]; scanf("%d ", &nc); for (cn=0; cn