# [C (gcc)], <s>790 778 757 748</s> 733 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(g**c,g**p){g*z=*c,*y=*p;for(i=-1;b=++i<S.c;b&&A(z,S.m[i]))for(l=0;k=l<z->c&b;b&=!k)for(j=0,u=z->m[l++];j<u->f.c&&(k=u->f.m[j++]->d-S.m[i]->d););z->c>y->c?y->c=0,a=z,*c=y,*p=a:(z->c=0);i=0;}main(){for(;~scanf("%d %d",&a,&b)&&A(&(u=B(a))->f,v=B(b))|~A(&v->f,u););for(E(&x,&p);b=i<S.c;)c[i]<i?a=S.m[b=i%2*c[i]++],S.m[b]=S.m[i],S.m[i]=a,E(&x,&p):(c[i++]=0);for(printf("largest clique size: %d\nclique members:",p->c);b<p->c;)printf(" %d",p->m[b++]->d);} This is a slightly golfed version of the reference implementation. [Try it online!](https://tio.run/##VVLBcuIwDL3zFWln8NiO0iFQWIgxTDtTfoAjyyFxQiaQ0DQhnQJLf52VHOjOHiJLT7Lek2LjpcZcr4djmcTJxqkPVWMOzsJZqP@hc7Y/OAZKtZCyUJdU3SttIlaps1EXtEs4wgfIL82OIEvNPtQLT2UKC1mLc@rNjOuu8Cg0@R6ack5hUCVhnr8bTgGQLV096AvZ74m1rtUlAxmCWU0mkzVEsIUd5Eq@8licsbPuqc17xTO9fDIq8zwlanSLVbb2ZrEXz@ugjdRDPa@1aZmG8CygxgIdwwtnS6hF0FNVcmiqvYOMC9mA/FRvKF8aQFPiAPKkMZBHLcsbpeerSLtuNiXuiLEXfoKWTQiqyFHcTufTE87LIqzQDzub2OoeNBrhYpW77lptp4032zwZxvhOW7dYbTFBI/wMI5RQ1Gl2RDMng11CfQJptF14GPCTRYXKkPlShNmeizMRqu/ahPsNf@zGTjd@BBYCiwQpZrzRrzwUAlnhE91IiD/fiH8S0BApNXjj7AtYKXDgdlxhUNU0m4d224h2@5IgVG13EK1vv@G2ER3CvUfAsRDrSCj1Lit8R6gtD6s0qfGp5dlHkzh1dkoCVPt7fwOKpIiSqg4eocQxUcqUTiXu9@1kJS01ancn1OV69fuTkTPwRx1/NOy1DiEUtd6w36Z@@X4Hv3@1mBj2LWzryMGY0nj4w9GwQ8ahZOv93GyTlmYwvlXdHdtvMG4FEJ/NEPD83MHP8cejm7LWQ0NSbOloMPkL "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(g**c,g**p){ g*z=*c,*y=*p; for(i=-1;b=++i<S.c;b&&A(z,S.m[i])) for(l=0;k=l<z->c&b;b&=!k) for(j=0,u=z->m[l++];j<u->f.c&&(k=u->f.m[j++]->d-S.m[i]->d);); z->c>y->c? y->c=0, a=z, *c=y, *p=a : (z->c=0); i=0; } main(){ for(;~scanf("%d %d",&a,&b)&&A(&(u=B(a))->f,v=B(b))|~A(&v->f,u);) for(E(&x,&p);b=i<S.c;) c[i]<i? a=S.m[b=i%2*c[i]++], S.m[b]=S.m[i], S.m[i]=a, E(&x,&p), : (c[i++]=0); for(printf("largest clique size: %d\nclique members:",p->c);b<p->c;) printf(" %d",p->m[b++]->d); }