| 855 | } |
| 856 | |
| 857 | void LemonLime::addTaskWithScoreScale(const QString &title, |
| 858 | const QList<std::pair<QString, QString>> &testCases, int sumScore, |
| 859 | int timeLimit, int memoryLimit) { |
| 860 | Task *newTask = new Task; |
| 861 | newTask->setProblemTitle(title); |
| 862 | newTask->setSourceFileName(title); |
| 863 | newTask->setInputFileName(title + ".in"); |
| 864 | newTask->setOutputFileName(title + ".out"); |
| 865 | newTask->refreshCompilerConfiguration(settings); |
| 866 | newTask->setAnswerFileExtension(settings->getDefaultOutputFileExtension()); |
| 867 | curContest->addTask(newTask); |
| 868 | int scorePer = sumScore / testCases.size(); |
| 869 | int scoreLos = sumScore - scorePer * testCases.size(); |
| 870 | |
| 871 | for (int i = 0; i < testCases.size(); i++) { |
| 872 | auto *newTestCase = new TestCase; |
| 873 | newTestCase->setFullScore(scorePer + static_cast<int>(i < scoreLos)); |
| 874 | newTestCase->setTimeLimit(timeLimit); |
| 875 | newTestCase->setMemoryLimit(memoryLimit); |
| 876 | newTestCase->addSingleCase(title + QDir::separator() + testCases[i].first, |
| 877 | title + QDir::separator() + testCases[i].second); |
| 878 | newTask->addTestCase(newTestCase); |
| 879 | } |
| 880 | } |
| 881 | |
| 882 | auto LemonLime::compareFileName(const std::pair<QString, QString> &a, |
| 883 | const std::pair<QString, QString> &b) -> bool { |
nothing calls this directly
no test coverage detected