# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
866285 | lomta | Poi (IOI09_poi) | C++17 | 471 ms | 31628 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 int long long
const int N=2005;
int arr[N][N];
main(){
int n,t,p;cin>>n>>t>>p;
for(int i=0;i<n;i++){
for(int j=0;j<t;j++){
cin>>arr[i][j];
}
}
vector<int> v(t,0);
for(int i=0;i<n;i++){
for(int j=0;j<t;j++){
if(arr[i][j]==0){
v[j]++;
}
}
}
vector<int> points(n,0);
for(int i=0;i<n;i++){
for(int j=0;j<t;j++){
points[i]+=arr[i][j]*v[j];
}
}
int ans=0;
p--;
for(int i=0;i<n;i++){
if(points[i]>=points[p] && i<p){
ans++;
}
else if(points[i]>points[p] && i>p){
ans++;
}
else{
continue;
}
}
//cout<<"here"<<endl;
cout<<points[p]<<" "<<ans+1<<endl;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |