P8948 [YsOI2022]NOIp和省选
先给大家看一段代码
#include <IOI/Burst_zero.h>
// using brain;
// using eye;
using body::foot;
using computer::keyboard;
using body::mouth;
int main() {
string t1;
mouth >> t1;
think result = foot.think(&t1);
while (result.err()) {
result.back(1);
}
keytype key = think.res();
key.run();
return 114514;
}
< CWorld -Wall YsOI2022.cwd
> YsOI2022.cwd: In function 'int main()':
> YsOI2022.cwd:13:24: error: loop judgment always true
> 13 | while (result.err()) {
> | ^
你一定会遇到的误区
对
什么的之类的东西。
然后得出通过判断
打表毒瘤题
观察答案,想一想就可以知道我们完全可以用一组
证:对于每一组输入,由于仅要求可行解,而又只给出大致的大小关系。所以,若对于一组输入的可行
就是搞出所有可能的值,然后
附打表程序(不完整版,需要填写核心)
int A = 600, B = 400;
for (int i = 0; i <= 600; i++) {
for (int j = 0; j <= 400; j++) {
if(/* Here */)a[/* Here */] = /* Here */,
b[/* Here */] = /* Here */;
}
}
for (int i = 1; i <= 2000; i++) {
cout /* Here */;
}
注:原来 CWorld -Wall YsOI2022.cwd 那块出了问题。
原来的:(就是那个 $)见问题区https://www.luogu.com.cn/discuss/559481
$ CWorld -Wall YsOI2022.cwd
> YsOI2022.cwd: In function 'int main()':
> YsOI2022.cwd:13:24: error: loop judgment always true
> 13 | while (result.err()) {
> | ^