1791B- Mathematical Circus- Denial of Judgement.

Revision en2, by armurox, 2023-10-23 09:51:24

Received the above error when submitting my code, with the qualification "FAIL- Participant has the answer but jury does not (Test Case 393)". This is my first time getting this error, but I assume it is a problem on the checker side. Is there somewhere I can report this? In case this is the place, here is my code:

include <stdio.h>

int main() { int t; scanf("%d", &t); for (int i = 0; i < t; i++) { int n, k; scanf("%d%d", &n, &k); if (k % 2) { printf("YES\n"); for (int j = 1; j < n; j+=2) { printf("%d %d\n", j, j + 1); } }

else
    {
        int num_valid = 0;
        for (int j = 2; j < n + 1; j += 2)
        {
            if (j % 4 > 0 && (j + k) % 4 == 0)
            {
                num_valid++;
            }
        }
        if (num_valid < n / 4 || k == 0)
        {
            printf("NO\n");
            continue;
        }

        printf("YES\n");
        int max_j = 0;
        for (int j = 1; j < n; j+=2)
        {
            if (j + 3 + 2 * (j / 2) < n + 1)
            {
                max_j= j;
                printf("%d %d\n", j, j + (3 + 2 * (j / 2)));
            }

        }

        max_j += 2;
        for (int j = 2; j < n + 1; j+=2)
        {
            if (j % 4 > 0)
            {
                printf("%d %d\n", j, max_j);
                max_j += 2;
            }
        }
    }
}

}

The error came in the second test case run.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English armurox 2023-10-23 09:55:14 224
en2 English armurox 2023-10-23 09:51:24 6
en1 English armurox 2023-10-23 09:50:38 1793 Initial revision (published)