|
|
@ -182,6 +182,7 @@ async function connect() { |
|
|
|
return subtasksItemCases.result.time |
|
|
|
return subtasksItemCases.result.time |
|
|
|
}) |
|
|
|
}) |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function flat(array, result = []) { |
|
|
|
function flat(array, result = []) { |
|
|
|
for (let i = 0; i < array.length; i++) { |
|
|
|
for (let i = 0; i < array.length; i++) { |
|
|
|
if (Array.isArray(array[i])) { |
|
|
|
if (Array.isArray(array[i])) { |
|
|
@ -192,23 +193,27 @@ async function connect() { |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const flatTimeArray = flat(timeArray); |
|
|
|
const flatTimeArray = flat(timeArray); |
|
|
|
const maxItemTime = Math.max.apply(this, flatTimeArray); |
|
|
|
const maxItemTime = Math.max.apply(this, flatTimeArray); |
|
|
|
let baseScore = 0; |
|
|
|
let baseScore = 0; |
|
|
|
if (judge_state.type === 0) { |
|
|
|
if (judge_state.type === 0 || judge_state.type === 1) { |
|
|
|
baseScore = 100; |
|
|
|
baseScore = 100; |
|
|
|
} |
|
|
|
} |
|
|
|
if (judge_state.type === 2) { |
|
|
|
if (judge_state.type === 2) { |
|
|
|
baseScore = syzoj.config.practice_rating |
|
|
|
baseScore = syzoj.config.practice_rating |
|
|
|
} |
|
|
|
} |
|
|
|
if (convertedResult.statusString === 'Accepted' && maxItemTime < problem_time_limit * 0.9) { |
|
|
|
if (convertedResult.statusString === 'Accepted' && maxItemTime < problem_time_limit * 0.9) |
|
|
|
|
|
|
|
{ |
|
|
|
const beyondTime = problem_time_limit - maxItemTime; |
|
|
|
const beyondTime = problem_time_limit - maxItemTime; |
|
|
|
const extraScore = (beyondTime / problem_time_limit).toString().slice(0, 3) * baseScore; |
|
|
|
const extraScore = (beyondTime / problem_time_limit).toString().slice(0, 3) * baseScore; |
|
|
|
if (judge_state.type === 2) { |
|
|
|
if (judge_state.type === 2) { |
|
|
|
judge_state.score = convertedResult.score + extraScore + syzoj.config.practice_rating; |
|
|
|
judge_state.score = convertedResult.score + extraScore + syzoj.config.practice_rating; |
|
|
|
} |
|
|
|
} |
|
|
|
judge_state.score = convertedResult.score + extraScore; |
|
|
|
judge_state.score = convertedResult.score + extraScore; |
|
|
|
} else { |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
judge_state.score = convertedResult.score; |
|
|
|
judge_state.score = convertedResult.score; |
|
|
|
} |
|
|
|
} |
|
|
|
judge_state.pending = false; |
|
|
|
judge_state.pending = false; |
|
|
|