Can someone understand the difference between these two solutions?

I got wrong answer and correct answer for two very similar solutions here: https://www.codechef.com/viewsolution/22656863, https://www.codechef.com/viewsolution/22656860

Essentially difference is:

Wrong answer:

#define GI ({int a;scanf("%d", &a);a;})
#define REP(i,n) for (int i = 0; i < n; i++)
REP(i, k) c[GI - 1] = (r[GI - 1] = true);

Correct answer

REP(i, k) {
  r[GI - 1] = true;
  c[GI - 1] = true;
}

I tried compiling with -O2 with g++ 7.3.0 and it worked as expected.

//