Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will cras
来源:互联网 发布:欧洲杯 网络直播 编辑:程序博客网 时间:2024/05/22 10:56
这是自己关于poj3669写的一部分的代码,一直出错,然后就不想写了。不知道自己哪里错了
#include<stdio.h>
#include<iostream>#include<algorithm>
#include<cstring>
using namespace std;
int Map[305][305]={0}, m;
int dx[5]={0, 0, 0, 1, -1};
int dy[5]={0, 1, -1, 0, 0};
int time[305][305];
void f(int x, int y, int t);
struct zuo
{
int x, y;
int t;
}a[50005];
bool cmp(zuo a, zuo b)
{
return a.t>b.t;
}
int main()
{
int a1, a2, a3;
int i, j;
cin>>m;
for(i=0; i<m; i++)
cin>>a[i].x>>a[i].y>>a[i].t;
sort(a, a+m, cmp);
for(i=0; i<m; i++)
{
a1 = a[i].x; a2 = a[i].y; a3 = a[i].t;
f(a1, a2, a3);
}
int maxx = a[0].x;
int maxy = a[0].y;
for(i=1; i<m; i++)
{
if(maxx <= a[i].x) maxx = a[i].x;
if(maxy <= a[i].y) maxy = a[i].y;
}
int maxxy = max(maxx, maxy);
for(i=0; i<m; i++)
cout<<a[i].x<<"\t"<<a[i].y<<"\t"<<a[i].t<<endl;
cout<<maxx<<"\t"<<maxy<<"\t"<<maxxy<<endl;
}
void f(int x, int y, int t)
{
int i;
for(i=0; i<5; i++)
{
Map[x+dx[i]][y+dy[i]] = 1;
time[x+dx[i]][y+dy[i]] = t;
}
}
0 0
- Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will cras
- foreigner ofen say that
- Meteor Shower
- Meteor Shower
- Meteor Shower
- An access occurred that is not valid(Axis2)
- requires that an attribute name is preceded by whitespace异常
- How to Write a Killer Software Testing QA Resume That Will Turn Into an Interview Call
- that
- that
- Crystal Reports supports reports that access ADO.NET datasets
- These books that decide to buy.
- that is my goal
- That is no regrets
- 130 In your production database, users report that they are unable to generate reports on an importa
- To say that twenty-eight stars
- You say that you love rain
- I want to say that to myself
- RPG游戏中购买显示框的创建以及程序
- 盗版软件满天飞,禁不了但可止得住!
- UVa 732 Anagrams by Stack
- 山东省第七届ACM省赛——Memory Leak
- 浏览器缓存
- Bessie hears that an extraordinary meteor shower is coming; reports say that these meteors will cras
- NAT 原理与NAT穿越
- JS拖拽元素 兼容IE (未测试)
- SQL to MongoDB
- Matrix67的情书 题解 恺撒移位密码
- (4.2.35.1)数据加密:Conceal
- 程序员如何谋划出月薪3万
- 常用知识备份
- FZU-2150-Fire Game