| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 571405 | amukkalir | Poi (IOI09_poi) | C++17 | 349 ms | 12048 KiB | 
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std; 
const int nax = 2000; 
int pt[nax+5]; 
signed main () {
    int n, t, p; 
    scanf("%d %d %d", &n, &t, &p); 
    
    bool sc[n][t]; 
    for(int i=0; i<n; i++) {
        for(int j=0; j<t; j++) {
            int x; scanf("%d", &x); 
            pt[j] += (x==0); 
            sc[i][j] = x; 
        }
    }
    //point, task, id 
    vector<pair<pair<int,int>, int>> ans; 
    for(int i=0; i<n; i++) {
        int point = 0, task = 0, id = i+1; 
        for(int j=0; j<t; j++) {
            task += sc[i][j]; 
            if(sc[i][j]) point += pt[j]; 
        }
        //cout << id << " " << point << endl; 
        ans.push_back({{-point, -task}, id}); 
    }
    sort(ans.begin(), ans.end()); 
    for(int i=0; i<n; i++) {
        //cout << ans[i].first.first*-1 << " " << ans[i].first.second*-1 << ' ' << ans[i].second << endl; 
        if(ans[i].second == p) {
            printf("%d %d", ans[i].first.first * -1, i+1); 
            return 0; 
        }
    }
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
