{"id":24151283,"url":"https://github.com/khanhtran0111/gentest","last_synced_at":"2026-06-09T12:31:17.086Z","repository":{"id":241556632,"uuid":"806987461","full_name":"khanhtran0111/GenTest","owner":"khanhtran0111","description":"Generate testcase for CP","archived":false,"fork":false,"pushed_at":"2025-07-06T07:46:05.000Z","size":24588,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-06T08:37:48.786Z","etag":null,"topics":["autobat","competitive-programming","cpp","testcases","testgenerator"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khanhtran0111.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-05-28T09:22:20.000Z","updated_at":"2025-07-06T07:46:08.000Z","dependencies_parsed_at":"2024-06-05T04:26:38.612Z","dependency_job_id":"3aa44a02-941c-41e7-8b77-f6fda261abf5","html_url":"https://github.com/khanhtran0111/GenTest","commit_stats":null,"previous_names":["khanhtran0111/gentest"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/khanhtran0111/GenTest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khanhtran0111%2FGenTest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khanhtran0111%2FGenTest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khanhtran0111%2FGenTest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khanhtran0111%2FGenTest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khanhtran0111","download_url":"https://codeload.github.com/khanhtran0111/GenTest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khanhtran0111%2FGenTest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34107865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autobat","competitive-programming","cpp","testcases","testgenerator"],"created_at":"2025-01-12T09:15:05.380Z","updated_at":"2026-06-09T12:31:17.081Z","avatar_url":"https://github.com/khanhtran0111.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hướng Dẫn Sử Dụng Script Sinh Test\nAuthors: Khanh Tran, Ngat Do - Code Dream Programming Learning Center\n\n## Bước 1: Tạo Folder Chứa Bài Tập cần được sinh test\nTạo một folder mới bên trong thư mục `problems`, đặt tên theo mã bài tập. Ví dụ:\n```\nproblems/\n    bai1/\n    bai2/\n    ...\n```\n\n## Bước 2: Thêm File Solution vào Thư mục `solutions`\nThêm file solution **C++ hoặc Python** vào folder `solutions`.\n- **Tên file phải trùng với tên folder của bài tập trong thư mục `problems`**.\n- Nếu viết bằng **C++**, đặt tên file là `\u003cproblemName\u003e.cpp`.\n- Nếu viết bằng **Python**, đặt tên file là `\u003cproblemName\u003e.py`.\n\nVí dụ với bài `bonghong`:\n```\nsolutions/\n    bonghong.cpp  (hoặc bonghong.py)\n```\n\n## Bước 3: Cấu Hình File `config.py`\n- **Copy file** `config_sample.py` vào thư mục bài tập.\n- **Đổi tên file** thành `config.py`.\n- **Chỉnh sửa các tham số** bên trong `config.py` như sau:\n\n```python\n# Tên bài toán (trùng với tên folder và file code)\nproblemName = \"bonghong\"\n\n# Số lượng test case cần sinh\ntotalOfTests = 20\n\n# Phân chia điểm theo subtask\nsubtasks = [50, 50]  # Subtask 1: 50%, Subtask 2: 50%. Thêm và điều chỉnh số lượng subtasks và % tương ứng nếu cần.\n\n# Giới hạn đầu vào của bài toán\nminN = 1\nmaxN = [1000, 1000000]  # Giới hạn đầu vào cho các subtasks tương ứng.\n```\n\n- Hàm `genInputContent(testID, curSubtask)` chịu trách nhiệm sinh dữ liệu đầu vào cho từng test case. Chỉnh sửa hàm sao cho phù hợp với dữ liệu từng đề bài. File `genUltils.py` chứa các hàm hỗ trợ sinh dữ liệu ngẫu nhiên và xử lý định dạng. Hãy tham khảo file này để biết thêm các hàm tiện ích.\n\n## Bước 4: Chạy Script Sinh Test\nChạy file `genTest.py` để tạo bộ test tự động:\n```sh\npython genTest.py\n```\n\nSau khi chạy xong, test cases sẽ được tạo trong thư mục bài tập. Bạn có thể kiểm tra output trong các file `*.out` tương ứng.\n\n---\nNếu muốn đơn giản hoá các bước, ít thao tác, có thể chạy file `app.py` để có thể một app trực quan nhất về sinh test cũng như thao tác đơn giản hơn. (Vẫn đang trong quá trình hoàn thiện, đây là phiên bản demo nên mong quý bạn đọc có thể sử dụng thử)\n\nNếu có vấn đề, góp ý, xin hãy gửi qua mail: giakhanhcnh@gmail.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhanhtran0111%2Fgentest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhanhtran0111%2Fgentest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhanhtran0111%2Fgentest/lists"}