Submission #829985

#TimeUsernameProblemLanguageResultExecution timeMemory
829985BaytoroCarnival Tickets (IOI20_tickets)C++17
11 / 100
1 ms724 KiB
#include "tickets.h" //#include "grader.cpp" #include <bits/stdc++.h> using namespace std; //#define int long long long long find_maximum(int k, vector<vector<int>> x) { int n=x.size(),m=x[0].size(); if(m==1){ vector<vector<int>> ans(n,vector<int>(m,0)); int sum=0; vector<int> v; for(int i=0;i<n;i++) v.push_back(x[i][0]); sort(v.begin(),v.end()); sum=(v[n/2]); long long res=0; for(int i=0;i<n;i++) res+=abs(x[i][0]-sum); allocate_tickets(ans); return res; } }

Compilation message (stderr)

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
   22 | }
      | ^
#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...