# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
231874 | anubhavdhar | Poi (IOI09_poi) | C++14 | 901 ms | 12164 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>
#define ll long long int
#define pb push_back
#define mp make_pair
#define FOR(i,n) for(i=0;i<(n);++i)
#define FORe(i,n) for(i=1;i<=(n);++i)
#define FORr(i,a,b) for(i=(a);i<(b);++i)
#define FORrev(i,n) for(i=(n);i>=0;--i)
#define ii pair<ll,ll>
#define vi vector<ll>
#define vii vector<ii>
#define ff first
#define ss second
#define cd complex<double>
#define vcd vector<cd>
#define ldd long double
#define dbgLine cout<<"Line : "<<__LINE__<<'\n'
#define all(x) (x).begin(),(x).end()
using namespace std;
const short int __PRECISION = 10;
const ll MOD = 1e9+7;
const ll INF = 1e17 + 1101;
const ll LOGN = 17;
const ll MAXN = 2e5+5;
const ll ROOTN = 320;
const ldd PI = acos(-1);
const ldd EPS = 1e-7;
int main()
{
/*
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
*/
int N, T, P, i, j;
cin>>N>>T>>P;
bool A[N][T];
FOR(i,N)
FOR(j,T)
cin>>A[i][j];
int score[T];
pair<int,pair<int, int>> Final[N];
FOR(j,T)
{
score[j] = 0;
FOR(i, N)
if(A[i][j] == 0)
++score[j];
}
FOR(i,N)
{
int tmpScore = 0, tmpSolved = 0;
FOR(j,T)
if(A[i][j])
++tmpSolved, tmpScore += score[j];
Final[i] = mp(-tmpScore, mp(-tmpSolved, i));
}
// FOR(i, T)
// cout<<score[i]<<' ';
// cout<<endl;
sort(Final, Final + N);
// FOR(i, N)
// cout<<Final[i].ss.ss<<' '<<Final[i].ff<<'\n';
FOR(i,N)
if(Final[i].ss.ss == P-1)
cout<<-Final[i].ff<<' '<<i+1, exit(0);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |