Submission #1078797

#TimeUsernameProblemLanguageResultExecution timeMemory
1078797UmairAhmadMirzaCarnival Tickets (IOI20_tickets)C++17
0 / 100
1 ms600 KiB
#include <bits/stdc++.h> using namespace std; int const N=1505; void allocate_tickets( vector<vector<int>> _x); long long find_maximum(int k, vector<vector<int>> d){ vector<int> all; int n=d.size(); int m=d[0].size(); vector<vector<int>> x=d; for(int i=0;i<n;i++) for(int j=0;j<n;j++) x[i][j]=-1; for(int i=0;i<n;i++){ x[i][0]=0; all.push_back(d[i][0]); } allocate_tickets(x); sort(all.begin(),all.end()); long long ans=0; for(int i=0;i<n;i++) ans+=abs(all[n/2]-all[i]); return ans; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:11:6: warning: unused variable 'm' [-Wunused-variable]
   11 |  int m=d[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...