Giter VIP home page Giter VIP logo

tps-example's Introduction

TPS範例題目

Quick Links

problems.pdf

ID gen solution tests statement validator config
A. pA gen solution check tests statement markdown pdf validator problem solutions subtasks

操作說明

題目設定、problem.json

參數 範例值 設定位置
競賽名稱 TPS範例題目 problem.jsoncontest_name欄位(所有題目皆需設定)
題目編號 A problem.jsonproblem_label欄位
題目代號 pA problem.jsonnamecode欄位
題目名稱 四則運算 problem.jsontitle欄位
時間限制 1 秒 problem.jsontime_limit欄位
記憶體限制 512 MB problem.jsonmemory_limit欄位
上傳間隔 120 秒 problem.jsonmin_submission_interval欄位

題本、statement/

題本使用Markdown撰寫並置於statement/index.md,格式請參照該連結。
切到題目目錄底下後使用tps statement指令產生PDF檔。

子任務配分、subtasks.json

子任務配分設定於subtasks.json。格式如下範例:

{
    "global_validators": ["validator.cpp"],
    "subtasks": {
        "task1": {
            "index": 1,
            "score": 40,
            "validators": []
        },
        "task2": {
            "index": 2,
            "score": 60,
            "validators": ["validator-2.cpp"]
        }
    }
}

subtasks底下的Key為各測資名稱(如task1),score為該測資的分數。

產生測資、gen/gen/data

產生測資的程式應置於gen/下。
以下說明適用於符合TPS產測方式的作法。
產測程式根據命令行參數來產生不同測資,該程式產生測資必須使用標準輸出(stdout),不能是檔案輸出。
gen/data設定各子任務所使用的程式名稱及參數。
每一行代表一個測資點,使用@subtask 測資名稱區分不同子任務,測資名稱不可有空白,並且應跟subtasks.json內相同。範例如下:

@subtask sample
manual sample-01.in

@subtask a0
gen task2 qutxm

@subtask 1e4
gen norm 0 10000 csizh

@subtask all
manual all-01.in
gen norm -1000000000 1000000000 jvnyj

如果需要手動產生測資,將測資檔放置於gen/manual,然後在gen/data寫入一行manual 測資檔名稱
切到題目目錄底下後使用tps gen指令產生測資檔於tests

驗測程式、validator/

驗證測資數值範圍、圖論題是否為一棵樹、是否連通等題目所給定的限制(與解題演算法無關)屬於驗測程式範疇,放置於validator/資料夾下。
並在subtasks.json設定要使用哪個驗測程式。
所有子任務都使用的設定於subtasks.jsonglobal_validators
單一子任務使用的則設定於對應子任務下的validators

測試不同演算法是否會TLE、得到哪些部分分數的程式應視為標程,請參閱標程說明。

將標程及其他拿部分分的解法都放在solutions/底下。
並在solutions.json設定標程如以下格式:

{
	"filename.cpp": {
		"verdict": "model_solution"
	}
}

其他解法是否設定於solutions.json皆無所謂。
verdict值可參閱官方說明is_verdict_expected函數

TPS預設使用diff -bq來檢查輸出是否正確,CMS可能使用不同的檢查指令,請在problem.json中設定"has_checker": false。如果要自己編寫checker,請設定"has_checker": true

資料夾結構

每題中包含以下目錄和檔案:

  • checker: 檢查輸出與標準答案是否相等的程式
  • gen: 所有產測資相關的程式碼,參見TPS的說明
  • gen/data: 測資產生指令,參見TPS的說明
  • scripts: TPS所使用的腳本
  • solution: 標程及其他解法程式碼(包含所有拿部分分的程式碼),不要跟 validator 搞混
  • solution/check.txt: 所有標程對於所有測資的執行狀況(包含是否WA、TLE),使用指令 make pA-check,參見Makefile
  • statement: 題本
  • statement/index.md: (TPS格式)markdown 格式的題目敘述,之後會以 pandoc 輸出成 PDF
  • statement/index.pdf: (TPS格式)用 tps statement 輸出的 PDF 題目敘述
  • tests: 測試資料
  • tests/mapping: 各子任務所屬測資檔案對應表(tps gen 自動產生),使用於自動匯入CMS時
  • validator: 驗證測資格式是否正確,是否符合範圍限制,各子任務是否符合各自限制,不要跟 solution 搞混
  • problem.json: 題目設定,包含時限及CMS設定
  • solutions.json: 標程設定,用以產生輸出檔的標程參數為 "verdict": "model_solution"
  • subtasks.json: 子任務分數設定

tps-example's People

Contributors

xi-plus avatar github-actions[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.