제출 #384747

#제출 시각아이디문제언어결과실행 시간메모리
384747nicholask카니발 티켓 (IOI20_tickets)C++14
0 / 100
4 ms748 KiB
#include "tickets.h" #include <bits/stdc++.h> #define pb push_back using namespace std; long long find_maximum(int k,vector <vector <int> > x){ int n=x.size(),m=x[0].size(); vector <vector <int> > ans(n,vector <int>(m,-1)); if (m==1){ vector <int> v; for (int i=0; i<n; i++) v.pb(x[i][0]); sort(v.begin(),v.end()); int opt=v[v.size()/2]; int sum=0; for (int i=0; i<n; i++) sum+=abs(opt-v[i]); for (int i=0; i<n; i++) ans[i][0]=0; allocate_tickets(ans); return sum; } }

컴파일 시 표준 에러 (stderr) 메시지

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