# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
962578 | starchan | Poi (IOI09_poi) | C++17 | 211 ms | 31804 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;
#define int long long
#define in array<int, 2>
#define f first
#define s second
#define pb push_back
#define pob pop_back
#define INF (int)1e17
#define MX (int)3e5+5
#define fast() ios_base::sync_with_stdio(false); cin.tie(NULL)
signed main()
{
fast();
int n, t, p;
cin >> n >> t >> p;
p--;
int a[n][t];
int b[n][t];
int d[t];
for(int i = 0; i < t; i++)
d[i] = 0;
array<int, 3> sc[n];
for(int i = 0; i < n; i++)
{
sc[i][0] = sc[i][1] = 0;
for(int j = 0; j < t; j++)
{
cin >> a[i][j];
if(!a[i][j])
d[j]++;
sc[i][1]-=a[i][j];
}
sc[i][2] = i;
}
for(int i = 0; i < n; i++)
{
for(int j = 0; j < t; j++)
{
cin >> a[i][j];
if(a[i][j])
sc[i][0]-=d[j];
}
}
sort(sc, sc+n);
for(int i = 0; i < n; i++)
{
if(sc[i][2] == p)
cout << (-sc[i][0]) << " " << (i+1) << "\n";
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |