# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
100361 |
2019-03-10T15:14:35 Z |
MatesV13 |
Konj (COCI19_konj) |
C++11 |
|
74 ms |
9208 KB |
#include <bits/stdc++.h>
using namespace std;
int n, a, b, c, d, x, y;
int U=1000, D, L=1000 ,R;
char konj[305][305]; bool v[305][305];
void dfs(int x, int y){
v[x][y]=1;
U = min(U,x);
D = max(D,x);
L = min(L,y);
R = max(R,y);
if (x-1>=0 and !v[x-1][y] and konj[x-1][y]=='#') dfs(x-1,y);
if (y-1>=0 and !v[x][y-1] and konj[x][y-1]=='#') dfs(x,y-1);
if (!v[x+1][y] and konj[x+1][y]=='#') dfs(x+1,y);
if (!v[x][y+1] and konj[x][y+1]=='#') dfs(x,y+1);
return;
}
int main (){
ios::sync_with_stdio(0);
cin.tie(0);
for (int i=0;i<=301;i++){
for (int j=0;j<=301;j++){
konj[i][j]='.';
}
}
cin >> n;
for (int i=0;i<n;i++){
cin >> a >> b >> c >> d;
for (int i=min(a,c);i<=max(a,c);i++){
for (int j=min(b,d);j<=max(b,d);j++){
konj[j][i]='#';
}
}
}
cin >> x >> y;
dfs(x,y);
for (int i=D;i>=U;i--){
for (int j=L;j<=R;j++){
cout << konj[i][j];
}
cout << endl;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
3 |
Correct |
74 ms |
9208 KB |
Output is correct |
4 |
Incorrect |
2 ms |
484 KB |
Output isn't correct |
5 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
6 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
7 |
Incorrect |
2 ms |
384 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 |
3 ms |
512 KB |
Output isn't correct |