Problem p03615 (C++)

Buggy submission (status: Runtime Error):
// I hate signal 11!!
#include <bits/stdc++.h>
#define MAX_N 215
#define MOD 998244353LL
#define LL long long
#define ccw(x, y, z, p, q, r)                                                  \
  (((x) - (z)) * (q) + ((y) - (x)) * (r) + ((z) - (y)) * (p))
using namespace std;
struct node {
  LL x, y;
} arr[MAX_N], b[MAX_N];
LL n, m, I, ans, t[MAX_N][MAX_N], cost[MAX_N], temp, z;
// I need angle sort stl...
// inline LL ccw(node x,node y,node z){return
// (x.x-z.x)*y.y+(y.x-x.x)*z.y+(z.x-y.x)*x.y;}
bool angle_sort(node x, node y) {
  z = ccw(x.x, arr[I].x, y.x, x.y, arr[I].y, y.y);
  if (z < 0)
    return true;
  if (z > 0)
    return false;
  return true;
}
void make_b() {
  LL i;
  m = 0;
  for (i = 1; i <= n; i++) {
    if (arr[I].y > arr[i].y || (arr[I].y == arr[i].y && arr[I].x >= arr[i].x))
      continue;
    b[++m] = arr[i];
  }
  sort(b + 1, b + m + 1, angle_sort);
}
int main() {
  LL i = 1, prev, curr, next, cnt, scnt;
  cost[0] = 1;
  while (i <= 203) {
    cost[i] = (cost[i - 1] * 2) % MOD;
    i++;
  }
  scanf("%lld", &n);
  for (i = 1; i <= n; i++)
    scanf("%lld %lld", &arr[i].x, &arr[i].y);
  // t[curr][next] : dp table, start i, curr and next node!!
  for (I = 1; I <= n; I++) {
    make_b();
    // first point : I(arr[I])...
    for (curr = 1; curr <= m; curr++) {
      for (next = curr + 1; next <= m; next++) {
        t[curr][next] = 0;
        if (ccw(arr[I].x, b[curr].x, b[next].x, arr[I].y, b[curr].y,
                b[next].y) == 0)
          continue;
        cnt = scnt = 0;
        for (i = curr + 1; i < next; i++) {
          if (ccw(b[curr].x, b[next].x, b[i].x, b[curr].y, b[next].y, b[i].y) >=
              0) {
            cnt++;
            if (ccw(arr[I].x, b[i].x, b[curr].x, arr[I].y, b[i].y, b[curr].y) ==
                0)
              scnt++;
          }
        }
        for (i = curr - 1; i > 0; i--) {
          if (ccw(arr[I].x, b[curr].x, b[i].x, arr[I].y, b[curr].y, b[i].y) !=
              0)
            break;
          if (ccw(b[curr].x, b[next].x, b[i].x, b[curr].y, b[next].y, b[i].y) >=
              0) {
            cnt++;
            scnt++;
          }
        }
        for (i = next + 1; i <= m; i++) {
          if (ccw(arr[I].x, b[next].x, b[i].x, arr[I].y, b[next].y, b[i].y) !=
              0)
            break;
          if (ccw(b[curr].x, b[next].x, b[i].x, b[curr].y, b[next].y, b[i].y) >=
              0)
            cnt++;
        }
        for (prev = curr - 1; prev > 0; prev--) {
          if (ccw(b[prev].x, b[curr].x, b[next].x, b[prev].y, b[curr].y,
                  b[next].y) > 0)
            t[curr][next] = (t[curr][next] + t[prev][curr]) % MOD;
        }
        t[curr][next] =
            ((t[curr][next] * cost[cnt - scnt]) % MOD + cost[cnt]) % MOD;
        ans = (t[curr][next] + ans) % MOD;
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}

Fixed submission:
// I hate signal 11!!
#include <bits/stdc++.h>
#define MAX_N 215
#define MOD 998244353LL
#define LL long long
#define ccw(x, y, z, p, q, r)                                                  \
  (((x) - (z)) * (q) + ((y) - (x)) * (r) + ((z) - (y)) * (p))
using namespace std;
struct node {
  LL x, y;
} arr[MAX_N], b[MAX_N];
LL n, m, I, ans, t[MAX_N][MAX_N], cost[MAX_N], temp, z;
// I need angle sort stl...
// inline LL ccw(node x,node y,node z){return
// (x.x-z.x)*y.y+(y.x-x.x)*z.y+(z.x-y.x)*x.y;}
bool angle_sort(node x, node y) {
  z = ccw(x.x, arr[I].x, y.x, x.y, arr[I].y, y.y);
  if (z < 0)
    return true;
  if (z > 0)
    return false;
}
void make_b() {
  LL i;
  m = 0;
  for (i = 1; i <= n; i++) {
    if (arr[I].y > arr[i].y || (arr[I].y == arr[i].y && arr[I].x >= arr[i].x))
      continue;
    b[++m] = arr[i];
  }
  sort(b + 1, b + m + 1, angle_sort);
}
int main() {
  LL i = 1, prev, curr, next, cnt, scnt;
  cost[0] = 1;
  while (i <= 203) {
    cost[i] = (cost[i - 1] * 2) % MOD;
    i++;
  }
  scanf("%lld", &n);
  for (i = 1; i <= n; i++)
    scanf("%lld %lld", &arr[i].x, &arr[i].y);
  // t[curr][next] : dp table, start i, curr and next node!!
  for (I = 1; I <= n; I++) {
    make_b();
    // first point : I(arr[I])...
    for (curr = 1; curr <= m; curr++) {
      for (next = curr + 1; next <= m; next++) {
        t[curr][next] = 0;
        if (ccw(arr[I].x, b[curr].x, b[next].x, arr[I].y, b[curr].y,
                b[next].y) == 0)
          continue;
        cnt = scnt = 0;
        for (i = curr + 1; i < next; i++) {
          if (ccw(b[curr].x, b[next].x, b[i].x, b[curr].y, b[next].y, b[i].y) >=
              0) {
            cnt++;
            if (ccw(arr[I].x, b[i].x, b[curr].x, arr[I].y, b[i].y, b[curr].y) ==
                0)
              scnt++;
          }
        }
        for (i = curr - 1; i > 0; i--) {
          if (ccw(arr[I].x, b[curr].x, b[i].x, arr[I].y, b[curr].y, b[i].y) !=
              0)
            break;
          if (ccw(b[curr].x, b[next].x, b[i].x, b[curr].y, b[next].y, b[i].y) >=
              0) {
            cnt++;
            scnt++;
          }
        }
        for (i = next + 1; i <= m; i++) {
          if (ccw(arr[I].x, b[next].x, b[i].x, arr[I].y, b[next].y, b[i].y) !=
              0)
            break;
          if (ccw(b[curr].x, b[next].x, b[i].x, b[curr].y, b[next].y, b[i].y) >=
              0)
            cnt++;
        }
        for (prev = curr - 1; prev > 0; prev--) {
          if (ccw(b[prev].x, b[curr].x, b[next].x, b[prev].y, b[curr].y,
                  b[next].y) > 0)
            t[curr][next] = (t[curr][next] + t[prev][curr]) % MOD;
        }
        t[curr][next] =
            ((t[curr][next] * cost[cnt - scnt]) % MOD + cost[cnt]) % MOD;
        ans = (t[curr][next] + ans) % MOD;
      }
    }
  }
  printf("%lld\n", ans);
  return 0;
}