求助交互题的配置
  • 板块学术版
  • 楼主Mysterious_Cat
  • 当前回复0
  • 已保存回复0
  • 发布时间2023/2/17 19:14
  • 上次更新2023/10/24 00:34:11
查看原帖
求助交互题的配置
384035
Mysterious_Cat楼主2023/2/17 19:14

rt,本人向一道题内上传了一个测试点,checker.cppinteractive_lib.cpp,想要出一道和 P1733 一模一样的题目。

测试点如下:

1.in

100

1.out 空文件,里面什么也没有。

checker.cpp 如下:

#include "testlib.h"
#include <bits/stdc++.h>
using namespace std;

int main(int argc, char* argv[]){
	registerInteraction(argc, argv);
	int n = inf.readInt();	// chosen integer
	cout.flush();	// to make sure output doesn't stuck in some buffer
	int left = 50;
	bool found = false;
	while(left > 0 && !found) {
		left --;
		int a = ouf.readInt(1, 1000000000);	// the number you tell me
		if(a < n)
			cout << -1 << endl;
		else if(a > n)
			cout << 1 << endl;
		else
			cout << 0 << endl, found = true;
		cout.flush();
	}
	if(!found)
		quitf(_wa, "couldn't guess the number with 50 questions");
	quitf(_ok, "guessed the number with %d questions!", 50 - left);
	
	return 0;
}

interactive_lib.cpp 空文件,里面什么也没有。

根据 交互题功能说明,我希望直接用 SPJ 与选手程序交互,所以将 interactive_lib.cpp 设置为空。

然后,我将 P1733 的标准程序提交到这道题时,显示 UKE can not write to the test-output-file,有些不理解。是我理解有误吗?

希望有大佬可以解答。

2023/2/17 19:14
加载中...