William Wei

Results 28 comments of William Wei

刚改完,实际上我怀疑是那个格式化的锅,它在我的修改中插入了三个字符 “```”。

> 个人建议保留两版实现,可供读者对比。 好,改完了。

这个要是均匀分布的话是不是很难 $O(n)$ 做?

在 Windows 下的一个 Bug: 总之重定向到 stdout 的行为没有成功,大概是因为 `con` 只是输出到控制台。

我认为我有必要先描述我的测试方法,以便后续讨论: + 编译后为 `a.exe`: ```cpp #include using namespace std; int main() { int a, b; cin >> a >> b; cout

那么,现在有一个奇怪的行为: https://github.com/luogu-dev/cyaron/blob/f82ae6498f236e65770c0c6d05f938d6b8a2f8d1/cyaron/graders/testlib_checker.py#L33-L36 如果直接跑测试,报错(临时文件名可能不同): ```plaintext Traceback (most recent call last): File "d:/Admin/Desktop/IDE/github/cyaron/test.py", line 10, in Compare.program("a.exe", input="data.in", std_program="a.exe", grader=tc) File "d:\Admin\Desktop\IDE\github\cyaron\cyaron\compare.py", line 231, in program do(program) File "d:\Admin\Desktop\IDE\github\cyaron\cyaron\compare.py", line 225, in...

然后如果改成这样,行为看起来就很对: ```python with tempfile.TemporaryDirectory() as checker_output_dir, \ open(path_join(checker_output_dir, 'input.txt'), 'w', newline='\n') as inf, \ open(path_join(checker_output_dir, 'output.txt'), 'w', newline='\n') as outf, \ open(path_join(checker_output_dir, 'answer.txt'), 'w', newline='\n') as ansf: ... ``` 并且如果出现错误可能报错信息也更可读(临时文件见名知意)。

鬼知道啥行为? 我只是把 `delete` 设为 `True` 了,我没有 `close`。

> 自增的话不一定是均匀生成的吧。话说为什么不能直接筛。 想均匀生成可以调 `prime_sieve` 再 `choice` 一个就完了,应该还是简单的;但是复杂度是 $O(V)$ 的,如果在范围内随一个数再向后查找就是期望 $O(\log V)$ 的了

+ https://github.com/luogu-dev/cyaron/pull/164