# [C (gcc)], <s>790 778 757 748 731</s> 687 bytes <!-- language-all: lang-c --> typedef struct F F;typedef struct{int c,p;F**m;}g;struct F{int d;g f;};g S,y,q,*x=&y,*p=&q;A(g*g,F*s){g->c++[g->m=g->c-g->p?g->m:realloc(g->m,(g->p+=32)*20)]=s;}i,*a,c[999],b,j,k,l;*B(d){F*s=0;for(i=S.c;i--;)s=S.m[i]->d-d?s:S.m[i];!s?s=calloc(5,4),s->d=d,A(&S,s):0;return s;}F*u,*v;E(){for(i=-1;b=++i<S.c;b&&A(x,S.m[i]))for(l=0;k=l<x->c&b;b&=!k)for(j=0,u=x->m[l++];j<u->f.c&&(k=u->f.m[j++]->d-S.m[i]->d););x->c>p->c?a=x,x=p,p=a:0;x->c=0;}main(){for(;~scanf("%d %d",&a,&b)&&A(&(u=B(a))->f,v=B(b))|~A(&v->f,u););for(E();i=b<S.c;)c[b]<b?a=S.m[i=b%2*c[b]++],S.m[i]=S.m[b],E(S.m[b]=a):(c[b++]=0);for(printf("largest clique size: %d\nclique members:",p->c);i<p->c;)printf(" %d",p->m[i++]->d);} This is a slightly golfed version of the reference implementation. [Try it online!](https://tio.run/##VVJdb@IwEHznV6RIRHayqQhfBxiDWqn8AR45HhInRIGEhpggehz963TXpj3dQ9bjmcnubBQVZErd76ePKk3SraNPdaNOztJZiv@pa344OQoqsfS8Utwy8e00QiIyZytuWFfwAUfwLtL9AK@S7lG8sMzLYOlpfs2CufL9NR6lJBxgqRZ0ndZpVBTvitEFqFa@7Pe41@vyjdTiloMXgVpPJpMNxLCDPRTCe2UJv2Jn2RXb95rlcvWsRB4EgmuE5TrfBPMkSBZ6am/iSS@0VHbSEAYcNBpkAi/MXYHm066o01NTHxycuPQa8M7ijfGrbR6EIpa@n89oSuy6L@wCti/n5Cgwxl4Wswtu5sbokE97I@xkFxqJdLkufH8jdrMmmG@fleuyvTSwXO9QoLA/sbnggjrNKyyLSF7gIiuoZIQhicdhtzLKD4944lOr6LBl7U7idJI2uBG4MaeQLmvkK4s4x0FwRhhz/vcT@TMRDc2hBrinyGVsluNqHW9mMU41cWTc6XlEYcbHxkaIN/DGLJARnzK0oEN2bcOqxj8DAxVRnaUaf54iPzapo/M/6RQj/j48iDIt47TW0zbQphhiRqfg3@@bdSr6eLn9Rlzc7vewNxk5/XDUCkfDrgXE0M2iYc9Kv8Kwhc8/LwrDnqGNjwDeScYjHI6GLSoOiRb9vGlFM6Y/fri@genXH9sANM8oRAwGLXyccDx6JLMIC0Ux1lF/8gU "C (gcc) – Try It Online") [C (gcc)]: https://gcc.gnu.org/ Slightly golfed less typedef struct F F; // student group typedef struct{ int c, // count p; // capacity F**m; // members }g; // student struct F{ int d; // id g f; // friends }; g S,y,q,*x=&y,*p=&q; A(g*g,F*s){ g->c++[g->m=g->c-g->p?g->m:realloc(g->m,(g->p+=32)*20)]=s; } i,*a,c[999],b,j,k,l; *B(d){ F*s=0; for(i=S.c;i--;) s=S.m[i]->d-d? s : S.m[i]; !s? s=calloc(5,4), s->d=d,A(&S,s) : 0; return s; } F*u,*v; E(){ for(i=-1;b=++i<S.c;b&&A(x,S.m[i])) for(l=0;k=l<x->c&b;b&=!k) for(j=0,u=x->m[l++];j<u->f.c&&(k=u->f.m[j++]->d-S.m[i]->d);); x->c>p->c?a=x,x=p,p=a:0; x->c=0; } main(){ for(;~scanf("%d %d",&a,&b)&&A(&(u=B(a))->f,v=B(b))|~A(&v->f,u);); for(E();i=b<S.c;) c[b]<b? a=S.m[i=b%2*c[b]++], S.m[i]=S.m[b], E(S.m[b]=a) : (c[b++]=0); for(printf("largest clique size: %d\nclique members:",p->c);i<p->c;) printf(" %d",p->m[i++]->d); }