Submission #717731

#TimeUsernameProblemLanguageResultExecution timeMemory
717731lukatasevPoi (IOI09_poi)C++14
0 / 100
536 ms16216 KiB
#include <iostream>
#include <set>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;

int main() {
    int n,t,p;
    int num;
    cin>>n>>t>>p;
    int taskPoint[2001] = {0};
    map<int, vector<int> > student;

    for(int i=1; i<=n; i++) {
        vector<int> temp;
        for(int j=1; j<=t; j++) {
            cin>>num;
            temp.push_back(num);
            if(num == 0) {
                taskPoint[j] += 1;
            }
        }
        student.insert({i, temp});
    }

    set<pair<int, int> > studentPoints;
    int tempNum;
    for(auto x: student) {
        tempNum = 0;
        for(auto y: x.second) {
            tempNum += taskPoint[y];
        }
        studentPoints.insert({tempNum, x.first});
    }

    int mesto=0;
    for(auto x: studentPoints) {
        mesto++;
        if(x.second == p) {
            cout<<mesto<<" "<<x.first<<endl;
        }
    }
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...