社区讨论

如果你在 Subtask 6&7 莫名其妙 WA

P13904「KFCOI Round #2」夏日·弥光参与者 3已保存回复 2

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
2 条
当前快照
1 份
快照标识符
@mhjb0ome
此快照首次捕获于
2025/11/03 23:37
4 个月前
此快照最后确认于
2025/11/03 23:37
4 个月前
查看原帖
The shift operators << and >> group left-to-right.shift-expression:
additive-expression
shift-expression << additive-expression shift-expression >> additive-expression
The operands shall be of integral or unscoped enumeration type and integral promotions are performed.
The type of the result is that of the promoted left operand. The behavior is undefined if the right operand is negative, or greater than or equal to the length in bits of the promoted left operand.
总之,p[i] >> cntcnt > 31 的时候是 UB。

回复

2 条回复,欢迎继续交流。

正在加载回复...