Submission #717736

# Submission time Handle Problem Language Result Execution time Memory
717736 2023-04-02T11:51:14 Z VMaksimoski008 Poi (IOI09_poi) C++14
0 / 100
191 ms 452 KB
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

void setIO()
{
    ios_base::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
}

bool cmp(pair<int, int> a, pair<int, int> b)
{
    if(a.second != b.second)
        return (a.second > b.second);
    else
        return (a.first < b.first);
}

int main()
{
    setIO();

    int n, t, p, x;
    int totalPoints = 0;
    cin >> n >> t >> p;

    vector<int> taskPoints(t+1, n);
    vector<int> phillipSolved;

    vector<pair<int, int> > rankList;

    for(int i=0; i<n; i++)
    {
        for(int j=0; j<t; j++)
        {
            cin >> x;
            if(x == 1)
                taskPoints[j+1] -= 1;

            if(i+1 == p)
            {
                if(x == 1)
                    phillipSolved.pb(j+1);
            }
        }
    }

    for(int h : phillipSolved)
        totalPoints += taskPoints[h];

    for(int i=1; i<=n; i++)
    {
        rankList.pb({i, 0});
        for(int j=1; j<=t; j++)
        {
            rankList[rankList.size()-1].second += taskPoints[j];
        }
    }

    sort(rankList.begin(), rankList.end(), cmp);

    int phillipRank = 0;

    for(auto a : rankList)
    {
        phillipRank++;
        if(a.first == p)
            break;
    }

    cout << totalPoints << " " << phillipRank << '\n';
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 Incorrect 0 ms 212 KB Output isn't correct
6 Incorrect 1 ms 212 KB Output isn't correct
7 Incorrect 1 ms 212 KB Output isn't correct
8 Incorrect 1 ms 212 KB Output isn't correct
9 Incorrect 1 ms 212 KB Output isn't correct
10 Incorrect 4 ms 212 KB Output isn't correct
11 Incorrect 7 ms 324 KB Output isn't correct
12 Incorrect 10 ms 212 KB Output isn't correct
13 Incorrect 32 ms 312 KB Output isn't correct
14 Incorrect 42 ms 316 KB Output isn't correct
15 Incorrect 70 ms 308 KB Output isn't correct
16 Incorrect 77 ms 304 KB Output isn't correct
17 Incorrect 113 ms 452 KB Output isn't correct
18 Incorrect 136 ms 436 KB Output isn't correct
19 Incorrect 173 ms 324 KB Output isn't correct
20 Incorrect 191 ms 340 KB Output isn't correct