codeforces #364b Cells Not Under Attack】的更多相关文章

比赛的时候 long long sum=n*n,计算不出1e10长度到数,没有搞掉. 哎,以后要注意这个地方.这个题其实不难: 统计能被攻击到的个数,然后用总的个数减掉就可以了.注意有些地方重复计算,要给去掉.     B. Cells Not Under Attack time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasy…
题目链接:http://codeforces.com/problemset/problem/701/B 题目大意: 输入一个数n,m, 生成n*n的矩阵,用户输入m个点的位置,该点会影响该行和该列,每输入一个点则输出剩余未受影响的单元数. 解题思路: 吃饭...留坑 2016.09.11 12:05 AC code: #include<bits/stdc++.h> using namespace std; int main() { int n,m,x,y,ans; long long sx,s…
B. Cells Not Under Attack time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya has the square chessboard of size n × n and m rooks. Initially the chessboard is empty. Vasya will consequen…
Cells Not Under Attack 题意: 给出n*n的地图,有给你m个坐标,是棋子,一个棋子可以把一行一列都攻击到,在根据下面的图,就可以看出让你求阴影(即没有被攻击)的方块个数 题解: 我先是认真的看了前面之后,发现看不懂,最后一看图,就明白了,这就似乎证明了图片已经超越了语言,MD 扯远了. 这题要这么想,增加了一个点,就要减少一行一列,之后再把他们拼到一起,之后发现也就是求x*y了(x是行没有出现的个数,y是列没有出现的个数) 还有就是要注意这题是longlong,又被ll坑了…
题目链接: B. Cells Not Under Attack 题意: n*n的棋盘,现在放m个棋子,放一个棋子这一行和这一列就不会under attack了,每次放棋子回答有多少点还可能under attack; 思路:对行和列标记; AC代码: #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #incl…
B. Cells Not Under Attack time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Vasya has the square chessboard of size n × n and m rooks. Initially the chessboard is empty. Vasya will consequen…
题目链接: 传送门 Cells Not Under Attack time limit per test:2 second     memory limit per test:256 megabytes Description Vasya has the square chessboard of size n × n and m rooks. Initially the chessboard is empty. Vasya will consequently put the rooks on t…
Cells Not Under Attack Vasya has the square chessboard of size n × n and m rooks. Initially the chessboard is empty. Vasya will consequently put the rooks on the board one after another. The cell of the field is under rook's attack, if there is at le…
Vasya has the square chessboard of size n × n and m rooks. Initially the chessboard is empty. Vasya will consequently put the rooks on the board one after another. The cell of the field is under rook's attack, if there is at least one rook located in…
http://codeforces.com/contest/701 A - Cards 水 // #pragma comment(linker, "/STACK:102c000000,102c000000") #include <iostream> #include <cstdio> #include <cstring> #include <sstream> #include <string> #include <alg…