- For each rejected submission, a -2 point penalty.
- UserA have submitted probelmID 1
- > score of problemID 1 is 10.
- > first two times rejectd
- > third time accepted.
-> score = 10 - 4 = 6
- UserA have submitted problemID 2
- > score of problemID 2 is 30
- > first time accepted. No penalty will be counted
- > score = 30
so final score for UserA = 30 + 6 = 36
Similar for UserB.
I know all I am doing is explanations. I have tried a lot with gorup by and other stuffs. May be my lack of knowledge on SQL is the problem.
I would really appreciate if someone help me on this.
, Sum(tblScore.score) As correct_answer_score
ON tblScore.problemID = tblSubmission.problemID
WHERE tblSubmission.accepted = 1
, Count(*) As number_of_incorrect_answers
, Count(*) * -2 As penalty_points
WHERE accepted = 0
(1) Aren't there more than one accepted submissions for a combimation of (user, problemID)?
Are there effective mechanism to prevent such data?
(2) If submissions of a user for a problemID were all failed (and the user gave up to submit anymore for the problemID),
how to score the (user, problemID)?
-2 * (number of (rejected) submissions)?