Submission #302656

#TimeUsernameProblemLanguageResultExecution timeMemory
302656jwvg0425Carnival Tickets (IOI20_tickets)C++17
0 / 100
1 ms288 KiB
#include "tickets.h" #include <stdio.h> #include <vector> #include <queue> #include <algorithm> #include <iostream> #include <string> #include <bitset> #include <map> #include <set> #include <tuple> #include <string.h> #include <math.h> #include <random> #include <functional> #include <assert.h> #include <math.h> #define all(x) (x).begin(), (x).end() #define xx first #define yy second using namespace std; template <typename T, typename Pr = less<T>> using pq = priority_queue<T, vector<T>, Pr>; using i64 = long long int; using ii = pair<int, int>; using ii64 = pair<i64, i64>; i64 find_maximum(int k, vector<vector<int>> x) { int n = x.size(); int m = x[0].size(); vector<vector<int>> answer(n, vector(m, -1)); i64 result = 0; for (int i = 0; i < n; i += 2) { if (abs(x[i][m - 1] - x[i + 1][0]) > abs(x[i + 1][m - 1] - x[i][0])) { answer[i][m - 1] = answer[i + 1][0] = 0; result += abs(x[i][m - 1] - x[i + 1][0]); } else { answer[i + 1][m - 1] = answer[i][0] = 0; result += abs(x[i + 1][m - 1] - x[i][0]); } } allocate_tickets(answer); return result; }
#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...