直接全 F 即 TLE。
O(n3logn) 草 n=1000,是不是有点困难了。
gen 如下:
#include<bits/stdc++.h>
#ifdef DEBUG_LOCAL
#include <mydebug/debug.h>
#endif
using ll = long long;
const int N = 5e5+5;
using namespace std;
int T,n;
void los(){
}int main(){
ios::sync_with_stdio(0),cin.tie(0);
cout << 1000 << " " << 1000 << "\n";
for(int i = 1;i <= 1000;i ++,cout << "\n") for(int j = 1;j <= 1000;j ++)
cout << "FR"[(i & 1) && (j & 1)];
}
测评结果(TLE 1.20s)。