답안 #936951

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
936951 2024-03-03T05:55:56 Z qwe1rt1yuiop1 Topical (NOI23_topical) C++17
12 / 100
146 ms 35560 KB
#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;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 2 ms 856 KB Output is correct
4 Correct 118 ms 35560 KB Output is correct
5 Correct 125 ms 35460 KB Output is correct
6 Correct 146 ms 35432 KB Output is correct
7 Correct 88 ms 29640 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 1 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 2 ms 856 KB Output is correct
4 Correct 118 ms 35560 KB Output is correct
5 Correct 125 ms 35460 KB Output is correct
6 Correct 146 ms 35432 KB Output is correct
7 Correct 88 ms 29640 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Incorrect 1 ms 348 KB Output isn't correct
10 Halted 0 ms 0 KB -