# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
443681 | Belgutei | Poi (IOI09_poi) | C++17 | 884 ms | 12060 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 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 |
---|---|---|---|---|
Fetching results... |