Submission #305439

#TimeUsernameProblemLanguageResultExecution timeMemory
305439Jarif_RahmanCarnival Tickets (IOI20_tickets)C++17
11 / 100
2 ms768 KiB
#include "tickets.h" #include <bits/stdc++.h> #define pb push_back #define f first #define sc second using namespace std; typedef long long int ll; typedef string str; vector<vector<int>> r; long long find_maximum(int k, vector<vector<int>>rrrr){ r = rrrr; int n = r.size(), m = r[0].size(); vector <ll> v; for(int i = 0; i < n; i++) v.pb(r[i][0]); sort(v.begin(), v.end()); ll b = (v[n/2] + v[n/2 - 1])/2; ll s = 0; for(ll x: v) s+=abs(x - b); allocate_tickets(vector<vector<int>>(n, vector<int>(1, 0))); return s; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:12:23: warning: unused variable 'm' [-Wunused-variable]
   12 |     int n = r.size(), m = r[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...