Submission #303602

#TimeUsernameProblemLanguageResultExecution timeMemory
303602medmdgCarnival Tickets (IOI20_tickets)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "tickets.h" using namespace std; unsigned long long int fin(vector<vector<int> > a,int n,int m,int k){ unsigned long long int ans=0; for(int i=0;i<n;i++){ int mid=0; for(int j=0;j<m;j++){ mid+=a[i][j]; } mid/=m; int ff=0; for(int j=0;j<m;j++){ if(abs(ff-mid)>abs(a[i][j]-mid)){ ff=a[i][j]; } } for(int j=0;j<m;j++){ ans+=abs(ff-a[i][j]); } } return ans; } unsigned long long int find_maximum(int k, vector<vector<int> > x){ int n=x.size(); int m=x[0].size(); if(m==1){ vector<vector<int> > ans(n); vector<vector<int> > answ(k); for(int i=0;i<n;i++){ ans[i].push_back(0); answ[0].push_back(x[i][0]); } allocate_tickets(ans); return fin(answ,k,n,k); } }

Compilation message (stderr)

tickets.cpp:24:24: error: ambiguating new declaration of 'long long unsigned int find_maximum(int, std::vector<std::vector<int> >)'
   24 | unsigned long long int find_maximum(int k, vector<vector<int> > x){
      |                        ^~~~~~~~~~~~
In file included from tickets.cpp:2:
tickets.h:3:11: note: old declaration 'long long int find_maximum(int, std::vector<std::vector<int> >)'
    3 | long long find_maximum(int k, std::vector<std::vector<int>> d);
      |           ^~~~~~~~~~~~
tickets.cpp: In function 'long long unsigned int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:37:1: warning: control reaches end of non-void function [-Wreturn-type]
   37 | }
      | ^