# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
328430 | israeladewuyi | Poi (IOI09_poi) | C++17 | 331 ms | 23840 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;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
#define PB push_back
#define pb pop_back
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n, t, p; cin>>n>>t>>p;
int arr[n][t];
for(int i = 0; i < n; i++){
for(int j = 0; j < t; j++){
cin >> arr[i][j];
}
}
vi v,w;
for(int i = 0; i < t; i++){
int nu = 0;
for(int j = 0; j < n; j++){
if(arr[j][i] == 0) nu++;
}
v.PB(nu);
}
for(int i = 0; i < n ; i++){
int tt = 0;
for(int j = 0; j < t; j++){
int t;
t = arr[i][j] * v[j];
tt += t;
}
w.PB(tt);
}
int score = w[p - 1];
cout<<score<<" ";
sort(w.begin(), w.end());
for(int i = 0; i < n; i++){
if(w[i] == score){
cout<<i + 1;
exit(0);
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |