hdu_1033(我怎么找到的这么水的题,只为保存代码。。。)
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int Max = ;
int ansx[Max],ansy[Max];
//0,1,2,3表示方向,顺时针标注
void ans(int tx,int ty, int dir,int id)
{
if(dir == ){
ansx[id+] = tx+;
ansy[id+] = ty;
}
else if(dir == ){
ansx[id+] = tx;
ansy[id+] = ty+;
}
else if(dir == ){
ansx[id+] = tx-;
ansy[id+] = ty;
}
else if(dir == ){
ansx[id+] = tx;
ansy[id+] = ty-;
}
}
int main()
{
int dir = ;
char query[Max];
while(~scanf("%s",query))
{
dir = ;
ansx[] = ,ansy[] = ;
int len = strlen(query);
for(int i = ; i < len; i++)
{
if(query[i]=='V') {
dir = (dir+)%;
ans(ansx[i],ansy[i],dir,i);
}
else if(query[i]=='A'){
dir = (dir+)%;
ans(ansx[i],ansy[i],dir,i);
}
}
printf("300 420 moveto\n");
for(int i = ; i <= len; i++){
printf("%d %d lineto\n",ansx[i],ansy[i]);
}
printf("stroke\nshowpage\n");
}
return ;
}
hdu_1033(我怎么找到的这么水的题,只为保存代码。。。)的更多相关文章
- 通过 thread dump 分析找到高CPU耗用与内存溢出的Java代码
http://heylinux.com/archives/1085.html通过 thread dump 分析找到高CPU耗用与内存溢出的Java代码 首先,要感谢我的好朋友 钊花 的经验分享. 相信 ...
- 8.2/baltic神(水)题
summary:10 bzoj1334: Description N个政党要组成一个联合内阁,每个党都有自己的席位数. 现在希望你找出一种方案,你选中的党的席位数要大于总数的一半,并且联合内阁的席位数 ...
- 【Richard 的刷(水)题记录】
大概想了想,还是有个记录比较好. 9/24 网络流一日游: 最大流:bzoj1711[Usaco2007 Open]Dining 拆点 BZOJ 3993 Sdoi2015 星际战争 二分 P.S.这 ...
- mysql练习题目试水50题,附建库sql代码
如果你没试过水的话,那一题一题地每一题都敲一遍吧.不管它们对你看来有多么简单. 建库代码 部分题目答案在末尾,可用ctrl f 搜索题号. 作业练习——学生-选课 表结构 学生表: Student ...
- 我的CodeF水A题之路
Codeforces Round #359 (Div. 2) A. Free Ice Cream 题目链接:http://www.codeforces.com/problemset/problem/6 ...
- codevs 1360 xth砍树 线段树不能再水的题了
连标记都不用打.. #include<cstdio> #include<cstring> #include<algorithm> using namespace s ...
- 【CodeForces 602B】G - 一般水的题2-Approximating a Constant Range
Description When Xellos was doing a practice course in university, he once had to measure the intens ...
- 【CodeForces 604B】F - 一般水的题1-More Cowbe
Description Kevin Sun wants to move his precious collection of n cowbells from Naperthrill to Exeter ...
- 【CodeForces 596A】E - 特别水的题5-Wilbur and Swimming Pool
Description After making bad dives into swimming pools, Wilbur wants to build a swimming pool in the ...
随机推荐
- MySQL sql语句获取当前日期|时间|时间戳
1.1 获得当前日期+时间(date + time)函数:now() mysql> select now();+———————+| now() |+———————+| 2013-04-08 20 ...
- ArcGIS API for JavaScript 4.2学习笔记[10] 2D添加指北针widget、视图保存、视图padding(第二章完结)
这几个例子是第二章除了入门之外比较简单的几个,就做个合集,把最核心的代码(第二参数)和 引用放上来即可,不作多解释. 2D地图添加指北针widget 2D地图一般修正方向为正北方就需要这个widget ...
- Who Will Win?
Gautam and Subhash are two brothers. They are similar to each other in all respects except one. They ...
- Oracle ADG搭建
Oracle Active Data Guard搭建 一:安装 1.基础环境配置 1.1.开启强制日志记录 DG日志发送方式中ARCH进程和LGWR进程的ASYNC模式都是基于日志同步的,所以我们必须 ...
- java基础->循环
while循环 格式: while(条件表达式) { // 条件表达式其实就是一个结果为boolean类型的代码 循环体; } 执行流程: 先判断条件表达式的值, 如果为true就执行循环体,执行 ...
- eclipse 更换 JDK 版本后报错
在实际开发过程中,可能由于项目的需要,我们需要更换 JDK 的版本.但是更换后会报错,如下: Java compiler level does not match the version of the ...
- python科学计算_numpy_线性代数/掩码数组/内存映射数组
1. 线性代数 numpy对于多维数组的运算在默认情况下并不使用矩阵运算,进行矩阵运算可以通过matrix对象或者矩阵函数来进行: matrix对象由matrix类创建,其四则运算都默认采用矩阵运算, ...
- opacity的背景透明&background中rgba的背景色透明
近期使用css实现了一个loading旋转加载的图片效果,类似gif动画 过程中,需要透明背景,但是图片不要透明 只要背景透明!只要背景透明!只要背景透明! 这里对透明模糊了,两种写法,模糊了 A: ...
- [Spark内核] 第32课:Spark Worker原理和源码剖析解密:Worker工作流程图、Worker启动Driver源码解密、Worker启动Executor源码解密等
本課主題 Spark Worker 原理 Worker 启动 Driver 源码鉴赏 Worker 启动 Executor 源码鉴赏 Worker 与 Master 的交互关系 [引言部份:你希望读者 ...
- 使用fruitstrap实现命令行将IPA包安装到iOS设备上
Requirements Mac OS X. Tested on Snow Leopard only. You need to have a valid iPhone development cert ...