题目链接: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. 在线运行Javascript,Jquery,HTML,CSS代码

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xht ...

  2. Spring Batch实践

    Spring Batch在大型企业中的最佳实践 在大型企业中,由于业务复杂.数据量大.数据格式不同.数据交互格式繁杂,并非所有的操作都能通过交互界面进行处理.而有一些操作需要定期读取大批量的数据,然后 ...

  3. [TCPIP]代理arp

    一 理论概述 \ 二 实验 实验一:代理arp在nat中的作用(实验发现一下是错的)     实验二.代理arp pc访问服务器想让走路由器(写32bit静态路由),右边的R arp server的时 ...

  4. 突然想起android与mfc差异

    两者都可以算作是客户端程序,都是做上位机用的.而且都是被动执行. 相同点: 1.MFC中,它是由 project的名字 里面的某个成员函数来初始化,窗体,以及窗体里面的变量. 后面都是监听消息循环.数 ...

  5. Python快速教程 尾声(转)

    原文地址: http://www.cnblogs.com/vamei/p/3603046.html 作者:Vamei 出处:http://www.cnblogs.com/vamei 欢迎转载,也请保留 ...

  6. 测试驱动开发实践 - Test-Driven Development(转)

    一.前言 不知道大家有没听过“测试先行的开发”这一说法,作为一种开发实践,在过去进行开发时,一般是先开发用户界面或者是类,然后再在此基础上编写测试. 但在TDD中,首先是进行测试用例的编写,然后再进行 ...

  7. chrome扩展

    chrome拓展开发实战:页面脚本的拦截注入 时间 2015-07-24 11:15:00  博客园精华区 原文  http://www.cnblogs.com/horve/p/4672890.htm ...

  8. 错误C2665: “AfxMessageBox”: 2 个重载中没有一个可以转换所有参数类型

    第一种方法: AfxMessageBox( "Simple   message   box. ");如果先定义一个CString   变量,再赋值就没问题CString   sTe ...

  9. zoeDylan.ImgChange 图片切换插件

    墨芈深夜发布插件——图片切换 附上下载地址:http://pan.baidu.com/s/17kKF3共享天地/[墨芈 插件]zoeDylan Plugins Code JS (function ($ ...

  10. WebGame开发总结

    不知不觉我们的项目开发有2年了,这两年来走了很多弯路,也收获了很多,今天在这里做一个总结. 项目基本情况: 服务器端采用c++和c#混合开发,网络层采用c++开发,业务逻辑用c#开发.客户端采用sil ...