<commit_before>CATS.Rule.Acm = Classify({
    init: function (model) {
        this.name = "acm";
        this.failed_run_penalty = 20;
    },

    compute_history: function (result_table, contest) {
        var tbl = result_table;
        var contest_start_time = contest.start_time;
        $.each(tbl.score_board, function (i, row) {
            $.each(row['problems'], function (k, v) {
                for (var i = 0; i < v['runs_cnt']; ++i) {
                    var run = CATS.Model.Run();
                    run['problem'] = v['problem'];
                    run['start_processing_time'] = CATS.App.utils.add_time(contest_start_time, Math.round(contest.compute_duration_minutes() / 2));
                    run['user'] = row['user'];
                    run['contest'] = contest.id;

                    if (v['is_solved'] && i + 1 == v['runs_cnt']) {
                        run['start_processing_time'] = CATS.App.utils.add_time(contest_start_time, v['best_run_time']);
                        run['status'] = 'accepted';
                    }
                    else
                        run['status'] = 'wrong_answer';
                    CATS.App.add_object(run);<commit_msg>rules/acm: Make sure emulated rejected runs happen before the accepted one<commit_after>CATS.Rule.Acm = Classify({
    init: function (model) {
        this.name = "acm";
        this.failed_run_penalty = 20;
    },

    compute_history: function (result_table, contest) {
        var tbl = result_table;
        var contest_start_time = contest.start_time;
        $.each(tbl.score_board, function (i, row) {
            $.each(row['problems'], function (k, v) {
                for (var i = 0; i < v['runs_cnt']; ++i) {
                    var run = CATS.Model.Run();
                    run['problem'] = v['problem'];
                    var d = Math.round((v['best_run_time'] ? v['best_run_time'] : contest.compute_duration_minutes()) / 2);
                    run['start_processing_time'] = CATS.App.utils.add_time(contest_start_time, d);
                    run['user'] = row['user'];
                    run['contest'] = contest.id;

                    if (v['is_solved'] && i + 1 == v['runs_cnt']) {
                        run['start_processing_time'] = CATS.App.utils.add_time(contest_start_time, v['best_run_time']);
                        run['status'] = 'accepted';
                    }
                    else
                        run['status'] = 'wrong_answer';
                    CATS.App.add_object(run);
{'fraction_non_alphanumeric': 0.14274385408406026, 'fraction_numerical': 0.003965107057890563, 'mean_word_length': 1.724622030237581, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '180829', 'n_tokens_mistral': 793, 'n_tokens_neox': 724, 'n_words': 136}