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

Vector random 不生效 #109

Open Mr-Python-in-China opened 9 months ago

Mr-Python-in-China commented 9 months ago

Luogu_P_5653_gen.py

import cyaron as c

N=10
K=3
while True:
    io=c.IO("1.in")
    n=c.randint(1,N)
    m=c.randint(1,n)
    k=c.randint(3,K)
    io.input_writeln(1)
    io.input_writeln(n,m,k)
    a=c.Vector.random(n,[(1,k)],2)
    io.input_writeln(a)
    c.Compare.program("./Luogu_P_9653.bitfile",input=io, std_program="./Luogu_P_9653_std.bitfile")

使用该代码对拍时发现 Vector.random 的参数 mode 未生效。 经测试,似乎是由于枚举 VectorRandomMode.repeatable 不能直接与 int 类型的 mode 比较导致。 望修复。

prayerhgq commented 8 months ago

对的,不生效,我目前都是自己改了库包代码。

hoapoc commented 4 months ago

可以使用这个语法来生成可重复值 Vector.random(n, [(1, 1000000)], vector.VectorRandomMode.repeatable)