MCPcopy Create free account
hub / github.com/Project-LemonLime/Project_LemonLime / addTaskWithScoreScale

Method addTaskWithScoreScale

src/lemon.cpp:857–880  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

855}
856
857void 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
882auto LemonLime::compareFileName(const std::pair<QString, QString> &a,
883 const std::pair<QString, QString> &b) -> bool {

Callers

nothing calls this directly

Calls 13

setProblemTitleMethod · 0.80
setSourceFileNameMethod · 0.80
setInputFileNameMethod · 0.80
setOutputFileNameMethod · 0.80
addTaskMethod · 0.45
setFullScoreMethod · 0.45
setTimeLimitMethod · 0.45
setMemoryLimitMethod · 0.45
addSingleCaseMethod · 0.45

Tested by

no test coverage detected