We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://oi-wiki.org/intro/common-mistakes/
这样写虽然在正确性上没有问题,但是如果你直接对函数的返回值取 max,如 `a = Max(func1(), func2())` ,而这个函数的运行时间较长,则会大大影响程序的性能,因为宏展开后是 `a = func1() > func2() ? func1() : func2()` 的形式,调用了三次函数,比正常的 max 函数多调用了一次。
这不止时间复杂度的问题了吧,例如 func1() 里面是 return ++a;,a 是全局变量,这样每次执行 func1() return 的值都不一样 2. Line 186
func1()
return ++a;
a
return
++ti[t]; // 记录结点访问次数方便测试
方便调试? 3. Line 237
- 指针指向的区域已经 `free` 或 `delete` 。
delete 内存区域怪怪的
delete
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
我正在访问这个页面(最好带链接)
https://oi-wiki.org/intro/common-mistakes/
我发现页面有这样的问题
这不止时间复杂度的问题了吧,例如
func1()
里面是return ++a;
,a
是全局变量,这样每次执行func1()
return
的值都不一样2. Line 186
方便调试?
3. Line 237
delete
内存区域怪怪的The text was updated successfully, but these errors were encountered: