This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int long long
using namespace std;
using pii = pair<int, int>;
void solve()
{
int n, k;
cin >> n >> k;
vector<vector<int>> a(n, vector<int>(k)), b = a;
for (auto &i : a)
for (auto &j : i)
cin >> j;
for (auto &i : b)
for (auto &j : i)
cin >> j;
vector<int> cur(k, 0), flag(n, 0);
while (1)
{
int ok = 0;
for (int i = 0; i < n; ++i)
if (!flag[i])
{
int okk = 1;
for (int j = 0; j < k; ++j)
okk &= cur[j] >= a[i][j];
if (okk)
{
ok = flag[i] = 1;
break;
}
}
if (!ok)
break;
}
cout << accumulate(flag.begin(), flag.end(), 0LL) << '\n';
}
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0);
solve();
return 0;
}
# | 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... |