Submission #1078856

#TimeUsernameProblemLanguageResultExecution timeMemory
1078856Muhammad_AneeqCarnival Tickets (IOI20_tickets)C++17
0 / 100
0 ms348 KiB
#include <vector> #include <set> #include <algorithm> using namespace std; void allocate_tickets( vector<vector<int>> _x); long long find_maximum(int k, vector<vector<int>> d) { int n=d.size(),m=d[0].size(); if (m==1) { vector<vector<int>>ans=d; vector<int>f; for (int i=0;i<n;i++) { ans[i][0]=0; f.push_back(ans[i][0]); } allocate_tickets(ans); sort(begin(f),end(f)); long long z=0; for (int i=0;i<n;i++) z+=abs(f[i]-f[n/2]); return z; } if (k==1) { pair<int,int>a[n]; for (int i=0;i<n;i++) a[i].first=d[i][0],a[i].second=d[i].back(); long long ans=0; } return 0; }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:30:13: warning: unused variable 'ans' [-Wunused-variable]
   30 |   long long ans=0;
      |             ^~~
#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...