Open spacelg opened 3 years ago
We can fix this test issue as below.
This function (in count_inversions.cc):
int CountSubarrayInversions(int start, int finish, vector
has several function calls in one expression. Compiler is allowed to call those fuctions in any order. If you re-write the function like this:
int CountSubarrayInversions(int start, int finish, vector
int mid = start + ((finish - start) / 2); int res = CountSubarrayInversions(start, mid, A_ptr); res += CountSubarrayInversions(mid, finish, A_ptr); res += MergeSortAndCountInversionsAcrossSubarrays(start, mid, finish, A_ptr);
return res; }
Test passes with optimizations.
Hi All,
Environment: VS 2019 + Windows Server 2016
EPIJudge failed to run C++ test 'count_inversions.exe' with MSVC on windows. It can be reproduced on latest version b736406 on master branch. Could you please help look at this issue?
Repro steps:
Error info: