제출 #838354

#제출 시각아이디문제언어결과실행 시간메모리
838354ma_moutahid카니발 티켓 (IOI20_tickets)C++17
11 / 100
1 ms676 KiB
#include "tickets.h" #include <vector> #include<bits/stdc++.h> using namespace std; long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(); int m = x[0].size(); long long prize=0; std::vector<std::vector<int>> answer(n, std::vector<int>(m)); vector<long long>v; for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ v.push_back(x[i][j]); answer[i][j]=0; } } allocate_tickets(answer); sort(v.begin(),v.end()); long long av=v[n/2]+v[n/2 -1]; av/=2; for(int i:v){ prize+=abs(i-av); } return prize; }
#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...