题意:给你一个n*n的矩阵,初始时,(x,y)的值为x+y.可能有两类操作,一类是对某一行求和,并将这一行置零:另一类是对某一列求和,并将这一列置零. 维护四个值:一个是列标号之和,一个是当前存在的列数,一个是行标号之和,另一个是当前存在的行数. 询问某一行的时候,只需要输出列标号之和+该行行号*当前存在列数,然后行数减一,行标号之和减去该行标号即可.列同理.注意不要重复删了. #include<cstdio> using namespace std; typedef long long ll…
题目链接:https://codeforces.com/gym/102028/problem/C Lewis likes playing chess. Now he has n rooks on the chessboard with $n$ rows and $n$ columns. All rows of the chessboard are labelled with $1$ through $n$ from top to bottom. All columns of the chessb…