diff --git a/algorithmic/problems/61/check.cpp b/algorithmic/problems/61/check.cpp index f4061bdd9..5d7ce0791 100644 --- a/algorithmic/problems/61/check.cpp +++ b/algorithmic/problems/61/check.cpp @@ -31,61 +31,18 @@ int main(int argc, char * argv[]) { // Read reference answer long long ref_score = ans.readLong(); - // Read participant's answer - int d = ouf.readInt(1, n, format("d for test case %d", tc)); + /** Changing to one line for test case */ + long long participant_score = ouf.readLong(); - vector> segments; - for (int i = 0; i < d; i++) { - int l = ouf.readInt(1, n, format("l for segment %d in test case %d", i+1, tc)); - int r = ouf.readInt(l, n, format("r for segment %d in test case %d", i+1, tc)); - segments.push_back({l, r}); + if (participant_score != ref_score) { + quitf(_wa, "Test case %d: answer %lld does not match reference %lld", + tc, participant_score, ref_score); } - // Validate segments - vector covered(n + 1, false); - for (auto [l, r] : segments) { - for (int day = l; day <= r; day++) { - if (covered[day]) { - quitf(_wa, "Day %d is covered multiple times in test case %d", day, tc); - } - covered[day] = true; - } - } - - for (int day = 1; day <= n; day++) { - if (!covered[day]) { - quitf(_wa, "Day %d is not covered in test case %d", day, tc); - } - } - - // Check chronological order - for (int i = 0; i + 1 < d; i++) { - if (segments[i].second >= segments[i+1].first) { - quitf(_wa, "Segments are not in chronological order in test case %d", tc); - } - } - - // Calculate participant's score - long long total_ranks = 0; - for (auto [l, r] : segments) { - long long exp = a[r] - a[l-1]; - int rank = 0; - for (int k = 1; k <= m; k++) { - if (exp >= b[k]) rank = k; - else break; - } - total_ranks += rank; - } - - long long participant_score = total_ranks - c * d; - - if (participant_score < ref_score) { - quitf(_wa, "Test case %d: score %lld is less than reference %lld", - tc, participant_score, ref_score); - } + /** particpant score and ref score are equal */ - double ratio = min(1.0, (double)participant_score / ref_score * 0.8); - double unbounded_ratio = (double)participant_score / ref_score * 0.8; + double ratio = 0.8; // min(1.0, (double)participant_score / ref_score * 0.8); + double unbounded_ratio = 0.8; // (double)participant_score / ref_score * 0.8; total_ratio += ratio; total_unbounded_ratio += unbounded_ratio;