제출 #532796

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

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:9:25: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  for(long long i = 0; i < x.size(); i++) {
      |                       ~~^~~~~~~~~~
tickets.cpp:11:26: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |   for(long long j = 0; j < x[0].size(); j++) {
      |                        ~~^~~~~~~~~~~~~
tickets.cpp:7:12: warning: unused variable 'K' [-Wunused-variable]
    7 |  long long K = k;
      |            ^
#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...