# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
443681 |
2021-07-11T10:07:13 Z |
Belgutei |
Poi (IOI09_poi) |
C++17 |
|
884 ms |
12060 KB |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll n,t,p;
bool b[2005][2005];
ll cnt[2005];
ll point[2005];
int main(){
cin>>n>>t>>p;
for(int i=1; i<=n; i++){
for(int j=1; j<=t; j++){
cin>>b[i][j];
// person / task
}
}
for(int i=1; i<=t; i++){
int a=0;
for(int j=1; j<=n; j++){
if(b[j][i]==1) a++;
}
a=n-a;
for(int j=1; j<=n; j++){
if(b[j][i]==1){
point[j]+=a;
cnt[j]++;
}
}
}
cout<<point[p]<<" ";
int ans=1;
for(int i=1; i<=n; i++){
if(point[i]>point[p]) ans++;
if(i!=p){
if(point[i]==point[p]){
if(cnt[i]>cnt[p]) ans++;
else{
if(cnt[i]==cnt[p]){
if(i<p) ans++;
}
}
}
}
}
cout<<ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
300 KB |
Output is correct |
4 |
Correct |
1 ms |
332 KB |
Output is correct |
5 |
Correct |
1 ms |
332 KB |
Output is correct |
6 |
Correct |
1 ms |
332 KB |
Output is correct |
7 |
Correct |
2 ms |
332 KB |
Output is correct |
8 |
Correct |
2 ms |
440 KB |
Output is correct |
9 |
Correct |
4 ms |
460 KB |
Output is correct |
10 |
Correct |
7 ms |
716 KB |
Output is correct |
11 |
Correct |
26 ms |
1112 KB |
Output is correct |
12 |
Correct |
42 ms |
1580 KB |
Output is correct |
13 |
Correct |
156 ms |
2864 KB |
Output is correct |
14 |
Correct |
178 ms |
3872 KB |
Output is correct |
15 |
Correct |
314 ms |
5600 KB |
Output is correct |
16 |
Correct |
343 ms |
6116 KB |
Output is correct |
17 |
Correct |
541 ms |
7952 KB |
Output is correct |
18 |
Correct |
572 ms |
9028 KB |
Output is correct |
19 |
Correct |
751 ms |
11300 KB |
Output is correct |
20 |
Correct |
884 ms |
12060 KB |
Output is correct |