QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#527694#7120. Soccergreen_gold_dog#1.5 752ms35416kbC++201.7kb2024-08-22 18:18:082024-08-22 18:18:08

Judging History

你现在查看的是最新测评结果

  • [2024-08-22 18:18:08]
  • 评测
  • 测评结果:1.5
  • 用时:752ms
  • 内存:35416kb
  • [2024-08-22 18:18:08]
  • 提交

answer

#include "soccer.h"
#include<bits/stdc++.h>

using namespace std;

typedef int ll;

ll biggest_stadium(ll n, vector<vector<ll>> f) {
	ll col = 0;
	set<ll> last;
	bool b = false;
	for (ll i = 0; i < n; i++) {
		bool iso = false;
		bool isop = false;
		set<ll> now;
		for (ll j = 0; j < n; j++) {
			if (f[i][j] == 0) {
				now.insert(j);
				col++;
				if (isop) {
					return n * n;
				}
				iso = true;
			} else {
				if (iso) {
					isop = true;
					iso = false;
				}
			}
		}
		set<ll> nl;
		if (!now.empty()) {
			for (auto i : now) {
				if (last.find(i) != last.end()) {
					nl.insert(i);
				}
			}
			if (!b) {
				nl = now;
			}
			if (nl.empty()) {
				return n * n;
			}
			b = true;
		}
		last = nl;
	}
	b = false;
	last.clear();
	for (ll i = 0; i < n; i++) {
		bool iso = false;
		bool isop = false;
		set<ll> now;
		for (ll j = 0; j < n; j++) {
			if (f[j][i] == 0) {
				now.insert(j);
				if (isop) {
					return n * n;
				}
				iso = true;
			} else {
				if (iso) {
					isop = true;
					iso = false;
				}
			}
		}
		set<ll> nl;
		if (!now.empty()) {
			for (auto i : now) {
				if (last.find(i) != last.end()) {
					nl.insert(i);
				}
			}
			if (!b) {
				nl = now;
			}
			if (nl.empty()) {
				return n * n;
			}
			b = true;
		}
		last = nl;
	}
	return col;
}

#ifdef LOCAL
int main()
{
    int N;
    assert(1 == scanf("%d", &N));
    std::vector<std::vector<int>> F(N, std::vector<int>(N));
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            assert(1 == scanf("%d", &F[i][j]));
        }
    }
    fclose(stdin);

    int res = biggest_stadium(N, F);

    printf("%d\n", res);
    fclose(stdout);
    return 0;
}
#endif

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1.5
Acceptable Answer

Test #1:

score: 6
Accepted
time: 0ms
memory: 3832kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
1
0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
1

result:

ok ok

Test #2:

score: 1.5
Acceptable Answer
time: 0ms
memory: 3888kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 0
0 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
9

result:

points 0.250 partial

Test #3:

score: 1.5
Acceptable Answer
time: 0ms
memory: 3912kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
100
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
10000

result:

points 0.250 partial

Test #4:

score: 1.5
Acceptable Answer
time: 26ms
memory: 5876kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
500
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
250000

result:

points 0.250 partial

Test #5:

score: 1.5
Acceptable Answer
time: 752ms
memory: 35416kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
2000
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
4000000

result:

points 0.250 partial

Test #6:

score: 6
Accepted
time: 0ms
memory: 3772kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
9
1 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
80

result:

ok ok

Test #7:

score: 6
Accepted
time: 0ms
memory: 4116kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
10
0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
99

result:

ok ok

Test #8:

score: 6
Accepted
time: 0ms
memory: 3820kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 0 0
0 0 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
8

result:

ok ok

Test #9:

score: 6
Accepted
time: 0ms
memory: 3820kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 0 0
1 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
8

result:

ok ok

Subtask #2:

score: 0
Wrong Answer

Test #10:

score: 2
Acceptable Answer
time: 0ms
memory: 3812kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 0
0 1 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
9

result:

points 0.250 partial

Test #11:

score: 2
Acceptable Answer
time: 0ms
memory: 3820kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 0
0 1 1
0 0 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
9

result:

points 0.250 partial

Test #12:

score: 2
Acceptable Answer
time: 0ms
memory: 3832kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 1
0 0 0
1 1 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
9

result:

points 0.250 partial

Test #13:

score: 2
Acceptable Answer
time: 0ms
memory: 3824kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
1 0 0
1 0 1
0 0 1

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
9

result:

points 0.250 partial

Test #14:

score: 0
Wrong Answer
time: 0ms
memory: 3820kb

input:

R0R7sb2atQWJ6SAWOjw4ZG7Gwgo5zl9L
3
0 0 1
0 0 0
1 0 0

output:

xlqtkQVzqzbOJxjzxlqsyVrlM2kqlbK0
OK
7

result:

wrong answer wrong

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%

Subtask #5:

score: 0
Skipped

Dependency #4:

0%

Subtask #6:

score: 0
Skipped

Dependency #1:

25%
Acceptable Answer

Dependency #2:

0%