제출 #384764

#제출 시각아이디문제언어결과실행 시간메모리
384764nicholask카니발 티켓 (IOI20_tickets)C++14
27 / 100
669 ms65724 KiB
#include "tickets.h" #include <bits/stdc++.h> #define pb push_back #define ll long long using namespace std; long long find_maximum(int k,vector <vector <int> > x){ ll n=x.size(),m=x[0].size(); vector <vector <int> > ans(n,vector <int>(m,-1)); if (k==1){ ll sum=0; priority_queue <pair <ll,ll>,vector <pair <ll,ll> >,greater <pair <ll,ll> > > pq; for (ll i=0; i<n; i++){ sum+=x[i][m-1]; pq.push({x[i][0]+x[i][m-1],i}); } for (ll i=0; i<n; i++){ if (i<n/2){ sum-=pq.top().first; ans[pq.top().second][0]=0; } else ans[pq.top().second][m-1]=0; pq.pop(); } allocate_tickets(ans); return sum; } }

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

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