数黑格有多少个,模拟题,POJ(1656)
2024-09-27 14:26:37
题目链接:http://poj.org/problem?id=1656
#include <stdio.h>
#include <iostream>
#include <string.h> using namespace std; int maps[][]; int main()
{
int t;
scanf("%d",&t);
memset(maps,,sizeof(maps)); while(t--)
{
char order[];
scanf("%s",order);
int x,y,l;
scanf("%d%d%d",&x,&y,&l); if(!strcmp(order,"BLACK"))
{
for(int i=x;i<=x+l-;i++)
{
for(int j=y;j<=y+l-;j++)
maps[i][j]=;
}
} if(!strcmp(order,"WHITE"))
{
for(int i=x;i<=x+l-;i++)
{
for(int j=y;j<=y+l-;j++)
maps[i][j]=;
}
} if(!strcmp(order,"TEST"))
{
int ans=;
for(int i=x;i<=x+l-;i++)
{
for(int j=y;j<=y+l-;j++)
if(maps[i][j]==)
ans++;
}
printf("%d\n",ans);
} }
return ;
}
最新文章
- C/C++内存泄漏及检测
- JAVA反射参数传递
- HDU 4283---You Are the One(区间DP)
- SSH免密码登录过程解析和实现
- eNSP的使用
- ios 解析html
- 弹出消息对话框ScriptManager
- Mybatis配置中遇到的问题和问题分析
- 浅谈“be practical and realistic”
- Jmeter初步使用三--使用jmeter自身录制脚本
- 标准简单SP模板(oracle)
- Storm博客收集
- C++面试经常涉及的概念1
- jquery实现图片上传前本地预览
- JVM堆外内存随笔
- .NET ORM框架 SqlSugar4.0 功能快速预览【开源】
- linux pwd命令 显示当前所在路径
- 10--Python入门--异常处理
- mod_conference ESL控制二(事件)
- UOJ33 [UR #2] 树上GCD 【点分治】【容斥原理】【分块】
热门文章
- Connection closing...Socket close. Connection closed by foreign host. Disconnected from remote host(centos6.9) at 14:59:05.
- java——删除链表中等于给定值的所有元素
- java——变量
- elasticsearch 插件 大全
- python-综合练习题(if条件语句,while循环,奇数偶数
- leetcode 196. Delete Duplicate Emails 配合查询的delete
- 性能测试工具LoadRunner25-LR之常用性能指标计算公式
- python的面向对象的特性(继承、封装、多态)
- mac os 和 ubuntu 上测试工具check-0.9.10的安装
- POJ 2594 —— Treasure Exploration——————【最小路径覆盖、可重点、floyd传递闭包】