luogu-dev / cyaron

CYaRon: Yet Another Random Olympic-iNformatics test data generator
GNU Lesser General Public License v3.0
1.31k stars 164 forks source link

Bug: 禁止重边和自环时程序卡死 #95

Open WillHouMoe opened 1 year ago

WillHouMoe commented 1 year ago

当我想造一个简单无向图时,程序会先生成几组数据,然后停住,不知道是什么原因。

报错: image

生成文件: image image

代码:

from cyaron import *

_n = ati([0, 10, 50, 100, 500, 1E3])
_m = ati([0, 30, 500, 1E3, 1E4, 1E6])
_times = ati([0, 5, 5, 5, 10, 10])
_cnt = 1

for i in range(1, 6):
    n = _n[i]
    m = _m[i]
    for j in range(1, _times[i] + 1):
        test_data = IO(file_prefix="short", data_id=_cnt)
        _cnt += 1
        in_n = randint(1, n)
        in_m = randint(1, m)
        s = randint(1, in_n)
        t = randint(1, in_n)
        test_data.input_writeln(in_n, in_m)
        graph = Graph.graph(in_n, in_m, weight_limit=(1, 10000000), self_loop=False, repeated_edges=False)
        test_data.input_writeln(graph)
        test_data.input_writeln(s, t)
        test_data.output_gen("E:\\***\\std.exe")