题意:给你一个n*n的矩阵,初始时,(x,y)的值为x+y.可能有两类操作,一类是对某一行求和,并将这一行置零:另一类是对某一列求和,并将这一列置零. 维护四个值:一个是列标号之和,一个是当前存在的列数,一个是行标号之和,另一个是当前存在的行数. 询问某一行的时候,只需要输出列标号之和+该行行号*当前存在列数,然后行数减一,行标号之和减去该行标号即可.列同理.注意不要重复删了. #include<cstdio> using namespace std; typedef long long ll…
Problem J. TriatripTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description The travel agency “Four Russians” is offering the new service for their clients. Unlike other agencies that only suggest one-way…