Submission #1072665

#TimeUsernameProblemLanguageResultExecution timeMemory
1072665LCJLYCarnival Tickets (IOI20_tickets)C++14
0 / 100
1 ms388 KiB
#include <bits/stdc++.h> #include "tickets.h" //#include "grader.cpp" using namespace std; #define show(x,y) cout << y << " " << #x << endl; #define show2(x,y,i,j) cout << y << " " << #x << " " << j << " " << #i << endl; #define show3(x,y,i,j,p,q) cout << y << " " << #x << " " << j << " " << #i << " " << q << " " << #p << endl; #define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl; typedef pair<int,int>pii; typedef pair<int,pii>pi2; //allocate_tickets(vector<vector<int>>) long long find_maximum(int k, vector<vector<int>>arr){ int n = arr.size(); int m = arr[0].size(); sort(arr[0].begin(),arr[0].end()); long long counter=0; vector<vector<int>>ans; ans.resize(n); for(int x=0;x<n;x++) ans[x]=vector<int>(m,0); for(int x=0;x<n/2;x++){ counter+=abs(arr[0][x]-arr[0][m-1-x]); } allocate_tickets(ans); return counter; }
#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...