Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vector random 不生效 #109

Open
Mr-Python-in-China opened this issue Oct 6, 2023 · 2 comments
Open

Vector random 不生效 #109

Mr-Python-in-China opened this issue Oct 6, 2023 · 2 comments

Comments

@Mr-Python-in-China
Copy link

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 added a commit to Mr-Python-in-China/cyaron that referenced this issue Oct 6, 2023
@prayerhgq
Copy link

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

@hoapoc
Copy link

hoapoc commented Feb 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants