# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
104106 | wiritos1 | Konj (COCI19_konj) | C++98 | 189 ms | 3148 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |