cyaron icon indicating copy to clipboard operation
cyaron copied to clipboard

Vector random 不生效

Open Mr-Python-in-China opened this issue 2 years ago • 2 comments

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 比较导致。 望修复。

Mr-Python-in-China avatar Oct 06 '23 14:10 Mr-Python-in-China

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

prayerhgq avatar Nov 05 '23 14:11 prayerhgq

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

hoapoc avatar Feb 20 '24 09:02 hoapoc