#include<bits/stdc++.h>
using namespace std;
struct punto
{
int x,y;
};
int n;
char mat[301][301];
int main()
{
cin>>n;
int xi=300,xf=0,yi=300,yf=0;
for(int a=0;a<301;a++)
{
for(int b=0;b<301;b++)
{
mat[a][b]='.';
}
}
punto i,f;
for(int a=0;a<n;a++)
{
cin>>i.x>>i.y>>f.x>>f.y;
xi=min(xi,min(i.x,f.x));
xf=max(xf,max(i.x,f.x));
yi=min(yi,min(i.y,f.y));
yf=max(yf,max(i.y,f.y));
if(i.x==f.x)
{
for(int b=min(i.y,f.y);b<max(i.y,f.y);b++)
{
mat[i.x][b]='#';
}
}
else
{
for(int b=min(i.x,f.x);b<max(i.x,f.x);b++)
{
mat[b][i.y]='#';
}
}
}
for(int b=yf;b>=yi;b--)
{
for(int a=xi;a<=xf;a++)
{
cout<<mat[a][b]<<" ";
}
cout<<'\n';
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
2 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
3 |
Incorrect |
189 ms |
3148 KB |
Output isn't correct |
4 |
Incorrect |
6 ms |
512 KB |
Output isn't correct |
5 |
Incorrect |
8 ms |
640 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
7 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
8 |
Incorrect |
4 ms |
512 KB |
Output isn't correct |
9 |
Incorrect |
3 ms |
512 KB |
Output isn't correct |
10 |
Incorrect |
7 ms |
640 KB |
Output isn't correct |