#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];
if(a!=xf)
{
cout<<" ";
}
}
if(b!=yi)
{
cout<<'\n';
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
2 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
3 |
Incorrect |
158 ms |
632 KB |
Output isn't correct |
4 |
Incorrect |
6 ms |
512 KB |
Output isn't correct |
5 |
Incorrect |
10 ms |
512 KB |
Output isn't correct |
6 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
7 |
Incorrect |
4 ms |
512 KB |
Output isn't correct |
8 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
9 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
10 |
Incorrect |
11 ms |
640 KB |
Output isn't correct |