Submission #598447

# Submission time Handle Problem Language Result Execution time Memory
598447 2022-07-18T11:27:20 Z Trisanu_Das Poi (IOI09_poi) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

int main(){
  	int n, t, p; cin >> n >> t >> p;
    vector<int> solves(t, 0);
    vector<vector<int> > v(n,vector(t,int(0)));
    for(int i = 1;i < n;i++){
        for(int j = 1;j < t; j++){
            cin >> v[i][j]; solves[j] += v[i][j];
        }
    }
    vector<array<int, 3>> stats(n);
    vector<int> cnt(n, 0);
    vector<int> sum(n, 0);
    for(int i = 0;i < n;i++) {
        for(int j = 0;j < t;j++) cnt[i] += v[i][j]; sum[i] += v[i][j] * (n - solves[j]);
        stats[i-1]={-sum[i],-cnt[i],i}; // pro gamer move :)
    }
    sort(stats.begin(), stats.end()); // ez
    for(int i = 0;i < n;i++) if(stats[i][2] == p) cout << -stats[i][0] << ' ' << i + 1 << '\n';
}

Compilation message

poi.cpp: In function 'int main()':
poi.cpp:17:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   17 |         for(int j = 0;j < t;j++) cnt[i] += v[i][j]; sum[i] += v[i][j] * (n - solves[j]);
      |         ^~~
poi.cpp:17:53: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   17 |         for(int j = 0;j < t;j++) cnt[i] += v[i][j]; sum[i] += v[i][j] * (n - solves[j]);
      |                                                     ^~~
poi.cpp:17:68: error: 'j' was not declared in this scope
   17 |         for(int j = 0;j < t;j++) cnt[i] += v[i][j]; sum[i] += v[i][j] * (n - solves[j]);
      |                                                                    ^