比赛 |
Asm.Def战记之圣地亚哥“杯2015 |
评测结果 |
AAAAAAATTT |
题目名称 |
Asm.Def的命令 |
最终得分 |
70 |
用户昵称 |
1azyReaper |
运行时间 |
33.914 s |
代码语言 |
C++ |
内存使用 |
1.84 MiB |
提交时间 |
2015-10-31 10:18:22 |
显示代码纯文本
#include <fstream>
#include <algorithm>
#include <cstdio>
#include <iomanip>
#define ifs ifstream
#define ofs ofstream
#define MAX 100001
#define XProgram
using namespace std;
//setprecision(1)<<std::fixed
ifs fin("asm_command.in");
ofs fout("asm_command.out");
class node
{
public:
double x,y;
}p[MAX];
int main()
{
int n,q;
int temp;
fin>>n>>q;
for(int i=1;i<=n;i++)
{
p[i].x=0;
p[i].y=i;
}//csh
for(int i=1;i<=q;i++)
{
fin>>temp;
if(temp==0)
{
int a;
fin>>a;
fout<<setprecision(1)<<std::fixed<<p[a].x<<' '<<setprecision(1)<<std::fixed<<p[a].y<<endl;
}
if(temp==1)
{
int a,b;
double dx,dy;
fin>>a>>b>>dx>>dy;
for(int j=a;j<=b;j++)
{
p[j].x+=dx;
p[j].y+=dy;
}
}
if(temp==2)
{
int a,b,deg;
fin>>a>>b>>deg;
for(int j=a;j<=b;j++)
{
if(deg==90)
{
for(int j=a;j<=b;j++)
{
double temp=p[j].x;
p[j].x=p[j].y*-1;
p[j].y=temp;
}
}
else if(deg==180)
{
for(int j=a;j<=b;j++)
p[j].x*=-1,p[j].y*=-1;
}
else if(deg==270)
{
for(int j=a;j<=b;j++)
p[j].y*=-1;
}
}
}
}
return 0;
}