Submission #1033002

#TimeUsernameProblemLanguageResultExecution timeMemory
1033002fv3Carnival Tickets (IOI20_tickets)C++14
11 / 100
1 ms604 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; ll find_maximum(int k, vector<vector<int>> x) { int N = x.size(); int M = x[0].size(); vector<vector<int>> answer; for (int i = 0; i < N; i++) { answer.push_back( {0} ); } allocate_tickets(answer); sort(x.begin(), x.end()); ll res = 0; for (int i = 0; i < N; i++) { res += abs(x[i][0] - x[N / 2][0]); } return res; }

Compilation message (stderr)

tickets.cpp: In function 'll find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:11:6: warning: unused variable 'M' [-Wunused-variable]
   11 |  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...