题目链接: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,sy;
int xx[],yy[];
while(scanf("%d",&n)!=EOF)
{
memset(xx,,sizeof(xx));
memset(yy,,sizeof(yy));
scanf("%d",&m);
sx=sy=(long long)n;
while(m--)
{
scanf("%d %d",&x,&y);
if(!xx[x])
{
sx--;
xx[x]=;
}
if(!yy[y])
{
sy--;
yy[y]=;
}
printf("%I64d\n",sx*sy);
}
}
return ;
}

CodeForces 701B Cells Not Under Attack的更多相关文章

  1. CF 701B Cells Not Under Attack(想法题)

    题目链接: 传送门 Cells Not Under Attack time limit per test:2 second     memory limit per test:256 megabyte ...

  2. codeforces #364b Cells Not Under Attack

    比赛的时候 long long sum=n*n,计算不出1e10长度到数,没有搞掉. 哎,以后要注意这个地方.这个题其实不难: 统计能被攻击到的个数,然后用总的个数减掉就可以了.注意有些地方重复计算, ...

  3. codeforces 701B B. Cells Not Under Attack(水题)

    题目链接: B. Cells Not Under Attack 题意: n*n的棋盘,现在放m个棋子,放一个棋子这一行和这一列就不会under attack了,每次放棋子回答有多少点还可能under ...

  4. Codeforces Round #364 (Div. 2) B. Cells Not Under Attack

    B. Cells Not Under Attack time limit per test 2 seconds memory limit per test 256 megabytes input st ...

  5. Codeforces Round #364 (Div. 2) Cells Not Under Attack

    Cells Not Under Attack 题意: 给出n*n的地图,有给你m个坐标,是棋子,一个棋子可以把一行一列都攻击到,在根据下面的图,就可以看出让你求阴影(即没有被攻击)的方块个数 题解: ...

  6. codeforces 701 B. Cells Not Under Attack

    B. Cells Not Under Attack time limit per test 2 seconds memory limit per test 256 megabytes input st ...

  7. Cells Not Under Attack

    Cells Not Under Attack Vasya has the square chessboard of size n × n and m rooks. Initially the ches ...

  8. cf701B Cells Not Under Attack

    Vasya has the square chessboard of size n × n and m rooks. Initially the chessboard is empty. Vasya ...

  9. Codeforces Round #364

    http://codeforces.com/contest/701 A - Cards 水 // #pragma comment(linker, "/STACK:102c000000,102 ...

随机推荐

  1. SilverIight数据绑定实例

    前台Code <DataGrid Name="DataGrid1" AutoGenerateColumns="False" IsReadOnly=&quo ...

  2. 爱奇艺招聘uwp开发

    招聘链接:https://job.cnblogs.com/offer/53380/ 工作地点:北京-海淀 工作年限:1年 学历要求:本科 招聘分类:移动开发工程师 工资范围:面议 职位要求 1.扎实的 ...

  3. CLR Profiler

    检查c#代码内存泄露工具-CLR Profiler 大家都知道.net有一套自己的内存(垃圾)回收机制,除非有一些数据(方法)长期占有内存不随着垃圾回收功能而释放内存,这样就造成了我们经常说的内存泄露 ...

  4. wireshark添加ip.id字段

    wireshark添加ip.id字段 为了在多个设备上追踪同一个数据包. 如果是同一个会话,则可以计算延迟, 如sta和应用服务器慢,这种问题,可以根据这个加上ip.id追踪数据到哪里慢了.    

  5. C# == equals 本质理解

    using System; using System.Diagnostics; using System.Text; using System.Collections; using System.Co ...

  6. RTX与SVN使用手册适用于新手

    一.RTX使用说明 1.下载 http://rtx.tencent.com/rtx/download/index.shtml rtx下载地址(可以只下载客户端) 2.使用方法 1)点击最下面的服务器设 ...

  7. 如何“刷leetcode”

    做题目的: 获得 offer 巩固算法与数据结构知识,将学到的东西用出来 如何做题: 根据章节与难度来做. 比如你学了 linked list,就去找到标签为 linked list 的题目,然后根据 ...

  8. vbs xml 解析

    代码如下: Class clsGetProfile ' ルートドキュメント Private rootDoc ' xmlファイル名とセクション名をセットする ' 引数: 「1」ファイル名 NOT NUL ...

  9. 免费Flash图表工具FusionChart

    图表显示是很多开发工作所必不可少的一项功能,今天我介绍一个前段时间发现的免费的Flash图表开发工具,可以通过Adobe Flash实现数据的图表化,动态化以及相互交互. FusionChart是一个 ...

  10. Django添加Last-Modified和ETag

    用Django REST Framework做的REST API,其中有个API有这样的需求: APP端请求这个API,服务器端从数据库读数据,返回json.返回的数据量稍微有些大,但是可能一年才修改 ...