#include "september.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
int solve(int N, int M, std::vector<int> F, std::vector<std::vector<int>> S) {
vector<vector<int>> prefMax(M, vector<int>(N, 0));
for (int i = 0; i < M; i++) {
prefMax[i][0] = S[i][0];
for (int j = 1; j < N-1; j++) {
prefMax[i][j] = max(prefMax[i][j-1], S[i][j]);
}
}
int k = 0;
for (int i = 0; i < N-1; i++) {
int currMax = prefMax[0][i];
for (int j = 1; j < M; j++) {
if (prefMax[j][i] != currMax) {
goto here;
}
}
if (currMax == i+1) k++;
here:;
}
return k;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |