Submission #305384

#TimeUsernameProblemLanguageResultExecution timeMemory
305384JooDdaeCarnival Tickets (IOI20_tickets)C++17
0 / 100
1 ms416 KiB
#include "tickets.h" #include<bits/stdc++.h> using namespace std; using ll = long long; long long find_maximum(int k, std::vector<std::vector<int>> x) { int n = x.size(); int m = x[0].size(); vector<vector<int>> v(1); for(int i=0;i<n;i++) v[0].push_back(x[i][0]); sort(v[0].begin(), v[0].end()); allocate_tickets(v); ll ans = 0; for(int i=0;i<n/2;i++) ans -= v[0][i]; for(int i=n/2;i<n;i++) ans += v[0][i]; return ans; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:8:9: 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...