Codeforces 1136F Cooperative Game (神仙题)

这种题就是难者不会,会者不难。

博客讲的很详细了

代码:

#include <bits/stdc++.h>
using namespace std;
string s;
int read() {
	int n;
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		cin >> s;
	return n;
}
int main() {
	while(1) {
		printf("next 0
");
		fflush(stdout);
		read();
		printf("next 0 1
");
		fflush(stdout);
		if(read() == 2) break;
	}
	while(1) {
		printf("next 0 1 2 3 4 5 6 7 8 9
");
		fflush(stdout);
		if(read() == 1) {
			printf("done
");
			fflush(stdout);
			break;
		}
	}
} 

  

原文地址:https://www.cnblogs.com/pkgunboat/p/10568995.html