#include <bits/stdc++.h>
#include "soccer.h"
using namespace std;
typedef long long ll;
int biggest_stadium(int n, vector<vector<int>> f) {
vector<pair<ll, ll>> v(n, {-1, -1}), h(n, {-1, -1});
ll num = 0;
bool done = false;
pair<ll, ll> prev = {-1, -1}, mn = {-1, -1};
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
if (!f[i][j]) {
if (done)
return 0;
if (v[i].first == -1) v[i].first = j;
if (j - v[i].second > 1 && v[i].second != -1)
return 0;
v[i].second = j;
num++;
}
}
if (v[i].first == -1 && num > 0) done = true;
if (prev.first == -1) {
prev = v[i];
mn = v[i];
continue;
}
if (v[i].first == -1) continue;
if (v[i].first > prev.first && v[i].second > prev.second)
return 0;
if (v[i].first < prev.first && v[i].second < prev.second)
return 0;
if (v[i].first > mn.first && v[i].second > mn.second)
return 0;
if (v[i].first < mn.first && v[i].second < mn.second)
return 0;
prev = v[i];
}
return num;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
0 ms |
348 KB |
partial |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
ok |
2 |
Correct |
0 ms |
436 KB |
ok |
3 |
Correct |
0 ms |
348 KB |
ok |
4 |
Correct |
0 ms |
348 KB |
ok |
5 |
Correct |
0 ms |
440 KB |
ok |
6 |
Partially correct |
1 ms |
348 KB |
partial |
7 |
Partially correct |
1 ms |
448 KB |
partial |
8 |
Partially correct |
13 ms |
2908 KB |
partial |
9 |
Partially correct |
202 ms |
39684 KB |
partial |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
ok |
2 |
Correct |
0 ms |
436 KB |
ok |
3 |
Partially correct |
1 ms |
344 KB |
partial |
4 |
Incorrect |
1 ms |
344 KB |
wrong |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
0 ms |
348 KB |
partial |
2 |
Correct |
0 ms |
348 KB |
ok |
3 |
Correct |
0 ms |
436 KB |
ok |
4 |
Partially correct |
1 ms |
344 KB |
partial |
5 |
Incorrect |
1 ms |
344 KB |
wrong |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
0 ms |
348 KB |
partial |
2 |
Correct |
0 ms |
348 KB |
ok |
3 |
Correct |
0 ms |
436 KB |
ok |
4 |
Correct |
0 ms |
348 KB |
ok |
5 |
Correct |
0 ms |
348 KB |
ok |
6 |
Partially correct |
1 ms |
344 KB |
partial |
7 |
Incorrect |
1 ms |
344 KB |
wrong |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
0 ms |
348 KB |
partial |
2 |
Correct |
0 ms |
348 KB |
ok |
3 |
Correct |
0 ms |
436 KB |
ok |
4 |
Correct |
0 ms |
348 KB |
ok |
5 |
Correct |
0 ms |
348 KB |
ok |
6 |
Partially correct |
1 ms |
344 KB |
partial |
7 |
Incorrect |
1 ms |
344 KB |
wrong |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Partially correct |
0 ms |
348 KB |
partial |
2 |
Correct |
0 ms |
348 KB |
ok |
3 |
Correct |
0 ms |
436 KB |
ok |
4 |
Correct |
0 ms |
348 KB |
ok |
5 |
Correct |
0 ms |
348 KB |
ok |
6 |
Correct |
0 ms |
440 KB |
ok |
7 |
Partially correct |
1 ms |
348 KB |
partial |
8 |
Partially correct |
1 ms |
448 KB |
partial |
9 |
Partially correct |
13 ms |
2908 KB |
partial |
10 |
Partially correct |
202 ms |
39684 KB |
partial |
11 |
Partially correct |
1 ms |
344 KB |
partial |
12 |
Incorrect |
1 ms |
344 KB |
wrong |
13 |
Halted |
0 ms |
0 KB |
- |