bnuoj 27987 Record of the Attack at the Orbit (模拟)
http://www.bnuoj.com/bnuoj/problem_show.php?pid=27987
【题意】:给定坐标输出图形
【题解】:处理坐标上的小技巧
【code】:
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h> using namespace std; #define N 100 char str[N*][N*]; void init()
{
int i,j;
for(i=;i<;i++)
{
for(j=;j<;j++)
{
str[i][j]='.';
if(i==)
{
str[i][j]='-';
}
if(j==)
{
str[i][j]='|';
}
if(i==&&j==)
{
str[i][j]='+';
}
}
}
} int main()
{
int t;
scanf("%d",&t);
init();
int x1=,y1=,x2=-,y2=-;
while(t--)
{
int x,y;
scanf("%d%d",&y,&x);
x=-x;
x+=;
y+=;
if(x1>x) x1=x;
if(y1>y) y1=y;
if(x2<x) x2=x;
if(y2<y) y2=y;
str[x][y]='*';
}
if(x1>) x1=;
if(y1>) y1=;
if(x2<) x2=;
if(y2<) y2=;
int i,j;
for(i=x1;i<=x2;i++)
{
for(j=y1;j<=y2;j++)
{
putchar(str[i][j]);
}
putchar();
}
return ;
}
bnuoj 27987 Record of the Attack at the Orbit (模拟)的更多相关文章
- URAL 1942 Attack at the Orbit
B - Attack at the Orbit Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & % ...
- URAL 1944 大水题模拟
D - Record of the Attack at the Orbit Time Limit:1000MS Memory Limit:65536KB 64bit IO Format ...
- bnuoj 29368 Check the Identity(栈)
http://www.bnuoj.com/bnuoj/problem_show.php?pid=29368 [题解]:模拟,然后对x,进行枚举,看是否所有都满足条件 [code]: #include ...
- bnuoj 29373 Key Logger(模拟双向队列)
http://www.bnuoj.com/bnuoj/problem_show.php?pid=29373 [题意]:模拟光标输入 [题解]:用双向列表模拟实现,这里用其他模拟会超时,注意内存的释放 ...
- UDP flood UDP Port Denial-of-Service Attack
https://baike.baidu.com/item/UDP%20flood/5504851 UDPFlood是日渐猖厥的流量型DoS攻击,原理也很简单.常见的情况是利用大量UDP小包冲击DNS服 ...
- 使用 Python 进行稳定可靠的文件操作
程序需要更新文件.虽然大部分程序员知道在执行I/O的时候会发生不可预期的事情,但是我经常看到一些异常幼稚的代码.在本文中,我想要分享一些如何在Python代码中改善I/O可靠性的见解. 考虑下述Pyt ...
- kafka同步异步消费和消息的偏移量(四)
1. 消费者位置(consumer position) 因为kafka服务端不保存消息的状态,所以消费端需要自己去做很多事情.我们每次调用poll()方法他总是返回已经保存在生产者队列中还未被消费者消 ...
- [POC]SuiteCRM 7.10.7 - 'record' SQL Injection
#################################################################### # Exploit Title: SuiteCRM - 're ...
- Identifying a distributed denial of service (DDOS) attack within a network and defending against such an attack
The invention provides methods, apparatus and systems for detecting distributed denial of service (D ...
随机推荐
- hdu 3743 树状数组
思路:我们只需坚守一个原则,本来就在左边的坚决不把它换到右边.也就是相邻的两个数,左边小,右边大,那么就不调换.这样对每个数,只要统计左边比它大的数的个数.可以从后面开始用树状数组统计比它小的数的个数 ...
- Java加密解密相关
关于解释加密解密中的填充方案: http://laokaddk.blog.51cto.com/368606/461279/ 关于对称加密中的反馈模式: http://blog.csdn.net/aaa ...
- SSIS_TXT有规则资料导入到EXCEL
SSIS开发需要完全安装sqlserver.本次demo是sqlserver2008. 1.创建项目 2.解决方案打开如图所示. 3.拉取一个序列容器,一个数据流任务. 4.在数据流任务点击.拉取一个 ...
- C# 微信扫码支付API (微信扫码支付模式二)
一.SDK下载地址:https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=11_1,下载.NET C#版本: 二.微信相关设置:(微信扫码 ...
- 如何把网站及数据库部署到Windows Azure
http://edi.wang/Post/2014/1/1/deploying-website-with-db-to-azure-custom-domain
- easyui知识累计.递增.
(001) 偶然发现 easyui 1.4.4 版本以下在使用easyloader时的一个bug(声明:只有在使用easyloader加载模块时有此问题) : (只测试过1.4.2, 1.4.3, 1 ...
- Java使用泛型类来提高方法的可重用性
我的技术博客经常被流氓网站恶意爬取转载.请移步原文:http://www.cnblogs.com/hamhog/p/3832268.html,享受整齐的排版.有效的链接.正确的代码缩进.更好的阅读体验 ...
- 关于fputs和fgets的几个细节
C语言中两个标准IO fputs和fgets都是针对行来进行数据的读取的!这里关于这两个IO函数我有几个小细节想在这里和大家分享一下,希望能够对大家产生帮助! 首先贴上这两个函数的函数声明,下面以这两 ...
- excel 导入功能
一:示例代码 //InputStream fis = new FileInputStream(tomcaturl+this.awardTask.getFileRoute());//可以通过上述方式获得 ...
- tomcat6.0添加ssi(*.shtml)配置
1.去掉tomcat6中conf/web.xml关于ssi的注释 <servlet> <servlet-name>ssi</servlet-name> <se ...