# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
572060 | jhkfsdgsjhklf | Poi (IOI09_poi) | C++17 | 551 ms | 18660 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.
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <vector>
using namespace std;
int wynik[2007];
vector<vector<int>> zadanie(2007);
int sizezadanie[2007];
int n=0,t=0,p=0;
int wyniki[2007];
int zrobione[2007];
int up=0,down=0;
int main()
{
cin>>n>>t>>p;
for(int i=1;i<=t;i++)sizezadanie[i]=n;
for(int i=1;i<=n;i++)zrobione[i]=0;
for(int i=1;i<=n;i++){
for(int y=1;y<=t;y++){
int wynik = 0;
cin>>wynik;
if(wynik==1){
zadanie[y].push_back(i);
sizezadanie[y]--;
zrobione[i]++;
}
}
}
for(int i=1;i<=t;i++){
for(auto x:zadanie[i]){
wyniki[x]+=sizezadanie[i];
}
}
for(int i=1;i<=n;i++){
if(wyniki[i]>wyniki[p])
up++;
else if(wyniki[i]==wyniki[p]){
if(zrobione[i]>zrobione[p])
up++;
else if(zrobione[i]>zrobione[p])
if(i>p)
up++;
}
}
cout<<wyniki[p]<<" "<<1+up;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |