Submission #1072886

#TimeUsernameProblemLanguageResultExecution timeMemory
1072886LCJLYCarnival Tickets (IOI20_tickets)C++14
11 / 100
1 ms856 KiB
#include <bits/stdc++.h> #include "tickets.h" //#include "grader.cpp" using namespace std; #define int long long #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<long long,long long>pii; typedef pair<long long,pii>pi2; //allocate_tickets(vector<vector<int>>) long long find_maximum(int32_t k, vector<vector<int32_t>>arr){ int n=arr.size(); int m=arr[0].size(); vector<pi2>v; for(int x=0;x<n;x++){ for(int y=0;y<m;y++){ v.push_back({arr[x][y],{x,y}}); } } sort(v.begin(),v.end()); int counter=0; vector<vector<int32_t>>ans; ans.resize(n); for(int x=0;x<n;x++){ for(int y=0;y<m;y++) ans[x].push_back(y); } for(int x=0;x<n*m/2;x++){ counter+=abs(v[x].first-v[n*m-1-x].first); } 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...