Submission #104107

#TimeUsernameProblemLanguageResultExecution timeMemory
104107wiritos1Konj (COCI19_konj)C++98
0 / 70
233 ms640 KiB
#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 timeMemoryGrader output
Fetching results...