{"id":13648251,"url":"https://github.com/luogu-dev/cyaron","last_synced_at":"2025-05-14T00:07:15.570Z","repository":{"id":20412486,"uuid":"89853823","full_name":"luogu-dev/cyaron","owner":"luogu-dev","description":"CYaRon: Yet Another Random Olympic-iNformatics test data generator","archived":false,"fork":false,"pushed_at":"2025-02-22T06:21:21.000Z","size":270,"stargazers_count":1498,"open_issues_count":38,"forks_count":176,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-05-11T19:48:59.629Z","etag":null,"topics":["aqours","cyaron","informatics","judge","lovelive","luogu","olympic","online","sunshine"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luogu-dev.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":"2017-04-30T13:55:43.000Z","updated_at":"2025-05-11T12:48:09.000Z","dependencies_parsed_at":"2022-08-10T03:11:03.799Z","dependency_job_id":"ea002472-199c-41df-a594-5919b7ebc69c","html_url":"https://github.com/luogu-dev/cyaron","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luogu-dev%2Fcyaron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luogu-dev%2Fcyaron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luogu-dev%2Fcyaron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luogu-dev%2Fcyaron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luogu-dev","download_url":"https://codeload.github.com/luogu-dev/cyaron/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254043711,"owners_count":22004999,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aqours","cyaron","informatics","judge","lovelive","luogu","olympic","online","sunshine"],"created_at":"2024-08-02T01:04:05.314Z","updated_at":"2025-05-14T00:07:15.508Z","avatar_url":"https://github.com/luogu-dev.png","language":"Python","readme":"# Project CYaRon\n**CYaRon** **Y**et **A**nother **R**andom **O**lympic-i**N**formatics test data generator\n\n**By Luogu** 项目地址: [https://github.com/luogu-dev/cyaron](https://github.com/luogu-dev/cyaron)\n\n\n[![](https://travis-ci.org/luogu-dev/cyaron.svg?branch=master)](https://travis-ci.org/luogu-dev/cyaron)\n\n你是否遇到以下情况：\n- 希望在5分钟内写出一组随机数据，并方便地使用它们对拍几个程序\n- 希望生成一个合适的随机图或者树，且有一定强度\n- 希望生成一组随机数列或者向量，且不能重复。\n\n那么，你可以借助 CYaRon 和 Python ，来快速生成一组数据。目前支持的特性有：\n\n- 建一个随机图（简单图或者非简单图，有向图或无向图，带权图或者无权图）\n- 建一个随机树（链状、随机树、或者菊花图，而且可以设定树的强弱）\n- 生成一组允许相同或者互相不同的多维向量（可以较快速度生成10^6组、范围到10^9的向量或者数列）\n- 根据函数解析式生成数列\n- 生成一些随机多边形，并且可以求面积、周长等\n- 从字典生成随机字符串、单词、句子、段落\n- 使用以上功能生成的数据和您其他地方下载的测试数据方便地进行程序对拍\n\n**快速上手指南**\n\n稳定版本可以从pip获取: `pip install cyaron`，在此之前，需要准备好Python。\n\n最新开发版可以克隆GitHub源代码: `git clone https://github.com/luogu-dev/cyaron.git`\n\n请您查看[CYaRon文档](https://github.com/luogu-dev/cyaron/wiki)和[CYaRon基本入门](https://github.com/luogu-dev/cyaron/wiki/%E5%9F%BA%E6%9C%AC%E5%85%A5%E9%97%A8)来学习如何使用CYaRon。\n\n若您发现文档中有缺漏，请提出Issue并暂时根据`examples`和源代码进行YY。 \n\nCYaRon基于Python。若您对Python不熟悉，可看[快速入门教程](https://github.com/luogu-dev/cyaron/wiki/Python-30%E5%88%86%E9%92%9F%E5%85%A5%E9%97%A8%E6%8C%87%E5%8D%97)。\n\n之后计划实现云Generator，即只需提供写好的脚本以及std，上传到服务器，即可下载一个测试数据的压缩包，真正实现5分钟生成一个测试数据！\n\n希望各位大佬一起来协助改进这个项目。希望这个项目可以帮助大家节省时间！\n\n**使用范例**\n```python\n#!/usr/bin/env python\n\nfrom cyaron import * # 引入CYaRon的库\n\n_n = ati([0, 7, 50, 1E4]) # ati函数将数组中的每一个元素转换为整形，方便您可以使用1E4一类的数来表示数据大小\n_m = ati([0, 11, 100, 1E4]) \n\n# 这是一个图论题的数据生成器，该题目在洛谷的题号为P1339\nfor i in range(1, 4): # 即在[1, 4)范围内循环，也就是从1到3\n    test_data = IO(file_prefix=\"heat\", data_id=i) # 生成 heat[1|2|3].in/out 三组测试数据\n\n    n = _n[i] # 点数\n    m = _m[i] # 边数\n    s = randint(1, n) # 源点，随机选取一个\n    t = randint(1, n) # 汇点，随机选取一个\n    test_data.input_writeln(n, m, s, t) # 写入到输入文件里，自动以空格分割并换行\n\n    graph = Graph.graph(n, m, weight_limit=5) # 生成一个n点，m边的随机图，边权限制为5\n    test_data.input_writeln(graph) # 自动写入到输入文件里，默认以一行一组u v w的形式输出\n\n    test_data.output_gen(\"D:\\\\std_binary.exe\") # 标程编译后的可执行文件，不需要freopen等，CYaRon自动给该程序输入并获得输出作为.out\n```\n\n**贡献**\n\n所有的贡献者请查看[光荣榜](https://github.com/luogu-dev/cyaron/wiki/光荣榜)页面，衷心感谢他们对CYaRon项目的付出。\n\n欢迎您对 CYaRon 做出贡献。若您有希望加入的功能，可以给我们提出 Issue ，或者自己动手实现，然后发起 Pull Request。\n\n有关于如何做出贡献的更详细内容，请查看[如何做出贡献](https://github.com/luogu-dev/cyaron/wiki/%E5%A6%82%E4%BD%95%E5%81%9A%E5%87%BA%E8%B4%A1%E7%8C%AE)。\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluogu-dev%2Fcyaron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluogu-dev%2Fcyaron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluogu-dev%2Fcyaron/lists"}