Submission #771635

#TimeUsernameProblemLanguageResultExecution timeMemory
771635khshgCarnival Tickets (IOI20_tickets)C++14
11 / 100
1 ms596 KiB
#include"tickets.h" #include<bits/stdc++.h> using namespace std; long long find_maximum(int k, vector<vector<int>> x) { int N = x.size(); int M = x[0].size(); vector<vector<int>> ans(N, vector<int>(1, 0)); allocate_tickets(ans); vector<int> s(N); for(int i = 0; i < N; ++i) { s[i] = x[i][0]; } sort(begin(s), end(s)); long long D = 0; for(int i = 0; i < N; ++i) { D += abs(s[i] - s[N / 2]); } return D; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:7:6: warning: unused variable 'M' [-Wunused-variable]
    7 |  int M = x[0].size();
      |      ^
#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...