Submission #587908

#TimeUsernameProblemLanguageResultExecution timeMemory
587908Valaki2Carnival Tickets (IOI20_tickets)C++14
11 / 100
2 ms852 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; #define k K #define x X #define int long long #define pb push_back #define mp make_pair #define fi first #define se second int n, m, k; int ans_val; vector<vector<int> > x; vector<vector<int> > ans; void solve() { vector<int> v(n, 0); for(int i = 0; i < n; i++) { v[i] = x[i][0]; } sort(v.begin(), v.end()); for(int i = 0; i < n / 2; i++) { ans_val -= v[i]; } for(int i = n / 2; i < n; i++) { ans_val += v[i]; } for(int i = 0; i < n; i++) { ans[i][0] = 0; } } #undef k #undef x int find_maximum(signed k, vector<vector<signed> > x) { n = (int) x.size(); m = (int) x[0].size(); K = k; X.assign(n, vector<int> (m, -2)); for(int i = 0; i < n; i++) { for(int j = 0; j < m; j++) { X[i][j] = x[i][j]; } } #define k K #define x X ans.assign(n, vector<int> (m, -1)); solve(); vector<vector<signed> > real_ans(n, vector<signed> (m, -2)); for(int i = 0; i < n; i++) { for(int j = 0; j < m; j++) { real_ans[i][j] = ans[i][j]; } } allocate_tickets(real_ans); return ans_val; }
#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...