Getting 'fatal' error at the IARCS Problem Archive

I am trying to solve this problem. But I am getting a ‘fatal’ error. I am not able to find the reason of the error as I think this code works fine. Please help me find why this produces a ‘fatal’ error. Here, you can see the submission queue. I continuously got three 'fatal’s. Also, if you just look at the list, you’ll see so many fatals, I think that I am missing something.

Here’s my code:

#include <iostream>
#include <iomanip>

#include <cmath>
#include <string>

#include <algorithm>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <vector>

using namespace std;

int main() {
    int n, k;
    cin >> n >> k;

    int maximum, j, new_index, temp;

    vector<int> array;
    array.resize(n);

    for (int c = 0; c < k; c++) {
        bool last = true;

        for (int index = 0; index < n; index++) {
            cin >> array[index];
            if (last && array[index] != n - index) {
                last = false;
            }
        }

        if (last) {
            for (int index = 0; index < n; index++) {
                cout << index + 1 << " ";
            }
            cout << endl;
            continue;
        }

        maximum = array[n-1];
        j = n-2;

        while (array[j] > maximum) {
            maximum = array[j];
            j--;
        }

        new_index = j + 1;
        for (int index = j + 1; index < n; index++) {
            if ((array[new_index] > array[index]) && (array[index] > array[j])) {
                new_index = index;
            }
        }

        temp = array[j];
        array[j] = array[new_index];
        array[new_index] = temp;

        sort(array.begin() + j + 1, array.end());

        for (int index = 0; index < n; index++) {
            cout << array[index] << " ";
        }
        cout << endl;
    }

    return 0;
}
2 Likes

I came here to post about the same issue and saw your post. My code also seems to be fine but gives fatal on their judge.

But you have already solved many other problems…

Also, I submitted the same code of the problem VOTERS which is in CODECHEF too and again got a ‘fatal’. Why? I think there is a version problem or the server is incorrectly compiling it because I went to the 2nd and 3rd pages and all C++ submissions are fatal. Actually I am not able to find a single CPP solution which got an AC.

I solved those problems about a month ago. All CPP solutions till the 17th page got fatal. They were submitted 3 weeks ago. Seems to be a problem with their server which they haven’t rectified yet.

When you see that many C++ submissions getting fatal, its intuitive to think that their server has some bias for that language :stuck_out_tongue: . Perhaps that judge was coded in JAVA and is taking out its frustration of C++ better than JAVA there, hahaha XD.

But honestly, It does look like an issue from their side. And i think it must have been reported before as well.

Whom to report? There is no information regarding this on their website.

Seriously? They didnt leave any “Contact Us” section or mail or anything? Thats weird :confused:

They have it at their main site. I’ve reported it. Let’s see what happens.

Hey, actually they are having some changes with their OS. Since some days the fatal error is showing up for C++ solutions, so just convert your code into ‘C’ and submit.