# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
961838 |
2024-04-12T14:44:34 Z |
rithvick_2004 |
Poi (IOI09_poi) |
C++14 |
|
180 ms |
16100 KB |
#include<bits/stdc++.h>
using namespace std;
int N,T,P;
struct finale
{
int id;
int p_solved;
int score;
bool operator< (const finale &F)
{
if(score!=F.score) return (score>F.score);
else if( p_solved!=F.p_solved) return(p_solved>F.p_solved);
else return(id>F.id);
}
};
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cin>>N>>T>>P; //no choice
int k;
int Contestant[N][T+1]; //N is number of participants and T is for task Contestant[N][T] stores the number of questions solved
int points[T]; //giving points for each task
fill(points,points+N,N); //initially all points are N
for (int i = 0; i < N; i++)
{
Contestant[i][T] =0;
for (int j = 0; j < T; j++)
{
cin>>k; // this is 1 or 0 but i took int so that I don't get a weird error
points[j]=points[j]-k; //understandable
Contestant[i][j]=k; //the 2D array get's filled
Contestant[i][T] =Contestant[i][T] +k;
}
}// all inputs taken
vector<finale> data(N);
for(int i=0; i<N;i++)
{
data[i].id=i+1;
data[i].p_solved=Contestant[i][T];
data[i].score =0;
for(int j =0; j<T;j++)
{
data[i].score=data[i].score+(Contestant[i][j])*(points[j]);
}
}
k=data[P-1].score;
cout<<k<<" ";
sort(data.begin(),data.end());
//now comes the rubbish O(n) part
for(int i=0; i<N;i++)
{
if(P==data[i].id)
{
cout<<i+1;
break;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
10 |
Correct |
2 ms |
348 KB |
Output is correct |
11 |
Incorrect |
7 ms |
856 KB |
Output isn't correct |
12 |
Incorrect |
9 ms |
1116 KB |
Output isn't correct |
13 |
Incorrect |
28 ms |
2652 KB |
Output isn't correct |
14 |
Correct |
37 ms |
3672 KB |
Output is correct |
15 |
Incorrect |
72 ms |
6312 KB |
Output isn't correct |
16 |
Correct |
70 ms |
6748 KB |
Output is correct |
17 |
Incorrect |
117 ms |
10064 KB |
Output isn't correct |
18 |
Correct |
124 ms |
11104 KB |
Output is correct |
19 |
Incorrect |
162 ms |
14424 KB |
Output isn't correct |
20 |
Correct |
180 ms |
16100 KB |
Output is correct |