Rt.
rc_Taurus 的题解未将 last 初始化为 2,代码过不了样例,且错别字极多(如“萝贝”、“联通块”等),所以申请撤下该题解。
提供一个 hack 此代码的 gen:
#include <cstdio>
#include <ctime>
#include <random>
using namespace std;
int n, x;
mt19937 Rand(time(0));
int main() {
uniform_int_distribution<int> randn(4000000, 5000000);
n = randn(Rand);
printf("%d\n0 1\n", n);
for (register int i = 1; i < n; ++i)
{
printf("%d %d\n", i & 1, 1 - (i & 1));
}
return 0;
}