제출 #572062

#제출 시각아이디문제언어결과실행 시간메모리
572062jhkfsdgsjhklfPoi (IOI09_poi)C++17
70 / 100
571 ms10852 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 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; 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 timeMemoryGrader output
Fetching results...