Submission #572063

#TimeUsernameProblemLanguageResultExecution timeMemory
572063jhkfsdgsjhklfPoi (IOI09_poi)C++17
100 / 100
597 ms10820 KiB
/******************************************************************************

                              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 main()
{
vector<vector<int>> zadanie(2007);
int sizezadanie[2007];
int n=0,t=0,p=0;
int wyniki[2007];
int zrobione[2007];
int up=0;
    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(i!=p){
            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;
}

Compilation message (stderr)

poi.cpp: In function 'int main()':
poi.cpp:55:22: warning: 'wyniki[<unknown>]' may be used uninitialized in this function [-Wmaybe-uninitialized]
   55 |     cout<<wyniki[p]<<" "<<1+up;
      |                      ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...