# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
230373 | CaroLinda | Poi (IOI09_poi) | C++14 | 417 ms | 17784 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>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define mkt make_tuple
#define debug printf
#define all(x) x.begin(),x.end()
#define lp(i,a,b) for(int i = a ; i< b ; i++)
#define ss second
#define ff first
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define mk make_pair
using namespace std ;
struct Contestant
{
int score, solved, id ;
Contestant() { score = solved = id = 0 ; }
bool operator < ( Contestant other ) const
{
if( score == other.score && solved == other.solved ) return id < other.id ;
if(score == other.score ) return solved > other.solved ;
return score > other.score ;
}
};
int N , T , P ;
int score_task[2010] , solved[2010][2010 ] ;
Contestant v[2010] ;
int main()
{
scanf("%d%d%d", &N, &T , &P ) ;
lp(i,1,N+1)
{
for(int j = 1 ; j <= T ; j++ )
{
scanf("%d", &solved[i][j] ) ;
v[i].solved += solved[i][j] ;
score_task[j] += !solved[i][j] ;
}
v[i].id = i ;
}
lp(i,1,N+1)
lp(j,1,T+1) v[i].score += solved[i][j] * score_task[j] ;
sort( v+1, v+1+N ) ;
lp(i,1,N+1)
if( v[i].id == P )
printf("%d %d\n" , v[i].score, i ) ;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |