제출 #306906

#제출 시각아이디문제언어결과실행 시간메모리
306906NicolaAbusaad2014카니발 티켓 (IOI20_tickets)C++14
11 / 100
2 ms768 KiB
#include "tickets.h" #include <bits/stdc++.h> using namespace std; long long find_maximum(int k, std::vector<std::vector<int> > x) { int n = x.size(); int m = x[0].size(); long long ans,median; vector<vector<int> > answer; vector<int>z; answer.resize(n); for(long i=0;i<n;i++){ z.push_back(x[i][0]); answer[i].push_back(0); } sort(z.begin(),z.end()); ans=0; median=z[n/2]; allocate_tickets(answer); for(long i=0;i<n;i++){ ans+=abs(z[i]-median); } return ans; }

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

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