답안 #382114

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
382114 2021-03-26T12:22:57 Z vishesh312 Poi (IOI09_poi) C++17
0 / 100
303 ms 23916 KB
#include "bits/stdc++.h"
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using ordered_set = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;
*/

#define all(x) begin(x), end(x)
#define sz(x) (int)x.size()

using ll = long long;
const int mod = 1e9+7;

void solve(int tc) {
    int n, m, p;
    cin >> n >> m >> p;
    vector<vector<int>> v(n, vector<int>(m));
    vector<int> point(m), score(n), cnt(n);
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            cin >> v[i][j];
            point[j] += (v[i][j] == 0);
            cnt[i] += v[i][j];
        }
    }
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            if (v[i][j]) score[i] += point[j];
        }
    }
    vector<array<int, 3>> res(n);
    for (int i = 0; i < n; ++i) {
        res[i] = {score[i], cnt[i], i};
    }
    sort(res.rbegin(), res.rend());
    int i = 0;
    while (res[i][2] < p-1) ++i;
    cout << score[i] << " " << i+1 << '\n';
}

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int tc = 1;
    //cin >> tc;
    for (int i = 1; i <= tc; ++i) solve(i);
    return 0;
}

# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Incorrect 1 ms 364 KB Output isn't correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Incorrect 1 ms 364 KB Output isn't correct
6 Incorrect 1 ms 364 KB Output isn't correct
7 Incorrect 2 ms 364 KB Output isn't correct
8 Incorrect 2 ms 364 KB Output isn't correct
9 Incorrect 3 ms 364 KB Output isn't correct
10 Incorrect 4 ms 492 KB Output isn't correct
11 Incorrect 10 ms 1004 KB Output isn't correct
12 Incorrect 16 ms 1516 KB Output isn't correct
13 Incorrect 46 ms 3820 KB Output isn't correct
14 Incorrect 67 ms 5356 KB Output isn't correct
15 Incorrect 116 ms 9196 KB Output isn't correct
16 Incorrect 123 ms 10092 KB Output isn't correct
17 Incorrect 200 ms 14752 KB Output isn't correct
18 Incorrect 206 ms 16364 KB Output isn't correct
19 Incorrect 279 ms 21652 KB Output isn't correct
20 Incorrect 303 ms 23916 KB Output isn't correct