# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
752815 | vjudge1 | Poi (IOI09_poi) | C++17 | 584 ms | 39676 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 <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<pll, ll> tpl;
const ll MAXN = 2e3 + 5;
ll n, t, p, arr[MAXN][MAXN], poinSoal[MAXN];
tpl standing[MAXN];
// {{Score, Jumlah}, Id}
bool cmp(tpl a, tpl b){
if (a == b)
{
return false;
}
if (a.first.first == b.first.first)
{
if (a.first.second == b.first.second)
{
return a.second < b.second;
}
return a.first.second > b.first.second;
}
return a.first.first > b.first.first;
}
int main(){
cin >> n >> t >> p;
for (int i = 1; i <= n; ++i)
{
for (int j = 1; j <= t; ++j)
{
cin >> arr[i][j];
if (arr[i][j] == 0)
{
poinSoal[j]++;
}
}
}
for (int i = 1; i <= n; ++i)
{
standing[i].second = i;
for (int j = 1; j <= t; ++j)
{
if (arr[i][j] == 1)
{
standing[i].first.first += poinSoal[j];
standing[i].first.second++;
}
}
}
sort(standing+1, standing+1+n, cmp);
for (int i = 1; i <= n; ++i)
{
if (standing[i].second == p)
{
cout << standing[i].first.first << " " << i << "\n";
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |