File: reservoir-liu-zhuge1.c

package info (click to toggle)
isl 0.12.2-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 9,164 kB
  • ctags: 6,976
  • sloc: ansic: 86,111; sh: 11,923; python: 1,907; cpp: 593; makefile: 352; perl: 9
file content (17 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
if (N >= 0 && M >= 0)
  for (int c1 = -4; c1 <= 3 * M + N; c1 += 1) {
    if (c1 >= 3 * M) {
      S2(M, -3 * M + c1);
    } else if (3 * floord(c1 - 2, 3) + 2 == c1 && c1 >= -1 && 3 * M >= c1 + 4)
      S1((c1 + 4) / 3, 0);
    for (int c3 = max(-3 * M + c1 + 3, c1 + 3 * floord(-c1 - 1, 3) + 3); c3 <= min(N - 1, c1); c3 += 3) {
      S2((c1 - c3) / 3, c3);
      S1((c1 - c3 + 3) / 3, c3 + 1);
    }
    if (N + 3 * floord(-N + c1, 3) == c1 && 3 * M + N >= c1 + 3 && c1 >= N) {
      S2((-N + c1) / 3, N);
    } else if (N >= c1 + 4)
      S1(0, c1 + 4);
    for (int c3 = max(-3 * M + c1, c1 + 3 * floord(-c1 - 1, 3) + 3); c3 <= min(N, c1); c3 += 3)
      S3((c1 - c3) / 3, c3);
  }