题目链接: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. pc加入域认证细节

    计算机组织形式 工作组(无法统一管理,无法统一身份验证) 域 win权限分配机制 管理本地用户 新建用户-加入管理员组. 针对文件夹基于(用户组)设置权限 用户SID 创建一个用户时候,每个用户都有一 ...

  2. C语言 数组做函数参数退化为指针的技术推演

    //数组做函数参数退化为指针的技术推演 #include<stdio.h> #include<stdlib.h> #include<string.h> //一维数组 ...

  3. mvc4中的 webapi 的使用方式

    目录 一:简单介绍什么是Web api 二:怎么定义的 Post Get Put 和 Delete 三:简单使用,直接从前台传递一个类到后台接收 四:其他获取值的方式 一:简单介绍什么是Web api ...

  4. 解决VC几个编译问题的方法——好用

    一.vc网络编程中遇到一个编译问题,原来是少了WSOCK32.LIB. 在 project-->settings-->Link-->Object/Library modules 中加 ...

  5. 获取iOS系统版本 --- UIDevice

    UIDevice类是一个单例,其唯一的实例( [UIDevice currentDevice] ) 代表了当前使用的设备. 通过这个实例,可以获得设备的相关信息(包括系统名称,版本号,设备模式等等). ...

  6. 【NDK开发】使用NDK开发android

    今天学习了一下android NDK,所以记录下来.据说NDK从r7开始自带编译器,在windows上无需配置cygwin的环境.现在我使用NDK r10来开发. 上午搭建的NDK并写了一个实例,不过 ...

  7. 微信小程序开发:http请求

    在微信小程序进行网络通信,只能和指定的域名进行通信,微信小程序包括四种类型的网络请求. 普通HTTPS请求(wx.request) 上传文件(wx.uploadFile) 下载文件(wx.downlo ...

  8. Bootstrap系列 -- 21. 表单提示信息

    平常在制作表单验证时,要提供不同的提示信息.在Bootstrap框架中也提供了这样的效果.使用了一个"help-block"样式,将提示信息以块状显示,并且显示在控件底部. < ...

  9. 《TCP/IP详解卷1:协议》第11章 UDP:用户数据报协议-读书笔记

    章节回顾: <TCP/IP详解卷1:协议>第1章 概述-读书笔记 <TCP/IP详解卷1:协议>第2章 链路层-读书笔记 <TCP/IP详解卷1:协议>第3章 IP ...

  10. [转]C#创建服务及使用程序自动安装服务,.NET创建一个即是可执行程序又是Windows服务的exe

    写在前面 原文地址:C#创建服务及使用程序自动安装服务,.NET创建一个即是可执行程序又是Windows服务的exe 这篇文章躺在我的收藏夹中有很长一段时间了,今天闲着没事,就自己动手实践了一下.感觉 ...