Submission #507591

# Submission time Handle Problem Language Result Execution time Memory
507591 2022-01-12T19:03:54 Z tabr Poi (IOI09_poi) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m, p;
    cin >> n >> m >> p;
    p--;
    vector<vector<int>> a(n, vector<int>(m));
    vector<int> b(m);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cin >> a[i][j];
            b[j] += !a[i][j];
        }
    }
    vector<int> c(n);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            c[i] += a[i][j] * b[j];
        }
    }
    vector<int> order(n);
    iota(order.begin(), order.end(), 0);
    stable_sort(order.begin(), order.end(), [&](int i, int j) { return c[i] < c[j]; });
    for (int i = 0; i < n; i++) {
        if (order[i] == p) {
            cout << c[p] << " " i + 1 << '\n';
        }
    }
    return 0;
}

Compilation message

poi.cpp: In function 'int main()':
poi.cpp:34:32: error: expected ';' before 'i'
   34 |             cout << c[p] << " " i + 1 << '\n';
      |                                ^~
      |                                ;