제출 #779259

#제출 시각아이디문제언어결과실행 시간메모리
779259jasmin카니발 티켓 (IOI20_tickets)C++17
0 / 100
1 ms212 KiB
#include "tickets.h" #include<vector> #include<algorithm> using namespace std; long long solvem1(int n, int k, vector<vector<int> >& x){ vector<int> s(n); for(int i=0; i<n; i++){ s[i]=x[i][0]; } sort(s.begin(), s.end()); int mi=s[n/2]; long long ans=0; for(int i=0; i<n; i++){ if(s[i]<mi){ ans += mi-s[i]; } else{ ans += s[i]-mi; } } return ans; } long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(); int m = x[0].size(); vector<vector<int> > answer(n, vector<int> (m, 1)); allocate_tickets(answer); long long ans=solvem1(n, k, x); return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...