# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
570733 | AGE | Konj (COCI19_konj) | C++14 | 139 ms | 3544 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define int long long
using namespace std;
const int N=1e6,M=2e3;
int maxx,maxy,minx,miny;
map< pair<int,int>, int> vis;
map< pair<int,int> , vector< pair<int,int> > > adj;
int ans[301][301];
void dfs(int xnode,int ynode){
vis[{xnode,ynode}]=1;
for(auto x:adj[{xnode,ynode}]){
if(vis[x]==1)
continue;
minx=min(minx,x.F);
miny=min(miny,x.S);
maxx=max(maxx,x.F);
maxy=max(maxy,x.S);
for(int i=xnode;i<=x.F;i++){
for(int j=ynode;j<=x.S;j++){
ans[i][j]=1;
}
}
dfs(x.F,x.S);
}
}
main()
{
int n;
cin>>n;
/*for(int i=0;i<n;i++){
int a,b,c,d;
cin>>a>>b>>c>>d;
adj[{a,b}].pb({c,d});
}*/
maxx=-1e18,minx=1e18,maxy=-1e18,miny=1e18;
for(int i=0;i<n;i++){
int a,b,c,d;
cin>>a>>c>>b>>d;
for(int i=min(a,b);i<=max(a,b);i++)
for(int j=min(c,d);j<=max(c,d);j++)
ans[i][j]=1;
minx=min(minx,min(a,b));
miny=min(miny,min(c,d));
maxx=max(maxx,max(a,b));
maxy=max(maxy,max(c,d));
}
int x,y;
cin>>x>>y;
ans[x][y]=1;
//dfs(x,y);
for(int j=maxy;j>=miny;j--){
for(int i=minx;i<=maxx;i++){
if(ans[i][j]==1)
cout<<"#";
else cout<<".";
}
cout<<endl;
}
return 0;
}
/*
2 2 6 2
2 2 2 6
6 2 6 4
6 4 6 6
2 6 6 6
6 2 8 2
8 2 10 2
10 2 12 2
12 2 12 4
12 4 6 4
6 2 6 1
8 2 8 0
10 2 10 1
12 2 12 0
42 42 42 43
2 2
*/
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |