# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
104106 | wiritos1 | Konj (COCI19_konj) | C++98 | 189 ms | 3148 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |