Solved:3 02 Rikka with Cake (树状数组) #include <bits/stdc++.h> using namespace std; typedef long long ll; int n, m, K; int cntx, cnty, cntl, cntr, cntu, cntd; struct node { int x, y, tx, ty; char dir; }E[100005]; node L[100005], R[100005], U[100005], D…