Submission #631118

# Submission time Handle Problem Language Result Execution time Memory
631118 2022-08-17T17:23:58 Z chinmoy_101 Poi (IOI09_poi) C++14
5 / 100
537 ms 8524 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long   
int main()
{
    int n, t, p;
    cin>>n >>t >>p;
    vector<int> points_for_each_task_array(t, 0);
    vector<vector<int> > arr(n, {0, 0});
    vector<pair<int, pair<int, int> > > final_standing(n, {0, {0, 0}}); // score, solves, -id
    //vector<pair<int, pair<int, int>> > final_standing(n, {0, {0, 0}});
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<t; j++)
        {
            cin>>arr[i][j];
            if(arr[i][j]==0)
            {
                points_for_each_task_array[j]++;
            }
        }
    }
    for(int i=0; i<n; i++)
    {
        int ans=0, no_of_problems_solved=0;
        for(int j=0; j<t; j++)
        {
            if(arr[i][j]==1)
            {
                ans+=points_for_each_task_array[j];
                no_of_problems_solved++;
            }
        }
        final_standing[i]={ans, {no_of_problems_solved, -i-1}};
    }
    sort(final_standing.begin(), final_standing.end());
    reverse(final_standing.begin(), final_standing.end());
    for(int i=0; i<n; i++)
    {
        if(final_standing[i].second.second==-p)
        {
            cout<<final_standing[i].first <<" " <<i+1 <<"\n";
            return 0;
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 1 ms 340 KB Execution killed with signal 6
3 Runtime error 1 ms 428 KB Execution killed with signal 6
4 Runtime error 1 ms 340 KB Execution killed with signal 6
5 Runtime error 1 ms 340 KB Execution killed with signal 6
6 Runtime error 1 ms 340 KB Execution killed with signal 6
7 Runtime error 2 ms 340 KB Execution killed with signal 6
8 Runtime error 2 ms 468 KB Execution killed with signal 6
9 Runtime error 3 ms 468 KB Execution killed with signal 6
10 Runtime error 5 ms 468 KB Execution killed with signal 6
11 Runtime error 18 ms 664 KB Execution killed with signal 6
12 Runtime error 30 ms 848 KB Execution killed with signal 6
13 Runtime error 84 ms 1592 KB Execution killed with signal 6
14 Runtime error 133 ms 2216 KB Execution killed with signal 6
15 Runtime error 199 ms 3416 KB Execution killed with signal 6
16 Runtime error 219 ms 3680 KB Execution killed with signal 6
17 Runtime error 313 ms 5324 KB Execution killed with signal 6
18 Runtime error 388 ms 5968 KB Execution killed with signal 6
19 Runtime error 515 ms 7716 KB Execution killed with signal 6
20 Runtime error 537 ms 8524 KB Execution killed with signal 6