제출 #411061

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

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:17:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |  for(long long i=0; i<vi.size(); i++){
      |                     ~^~~~~~~~~~
tickets.cpp:6:12: warning: unused variable 'm' [-Wunused-variable]
    6 |  long long 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...