Submission #301632

#TimeUsernameProblemLanguageResultExecution timeMemory
301632maximath_1Carnival Tickets (IOI20_tickets)C++17
0 / 100
1 ms384 KiB
#include "tickets.h" #include <vector> #include <algorithm> 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>> as; as.push_back(x[0]); allocate_tickets(as); sort(x[0].begin(), x[0].end()); int md = n / 2; int ans = 0; for(int i = 0; i < n; i ++) ans += abs(x[0][i] - x[0][md]); return ans; }

Compilation message (stderr)

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