제출 #603745

#제출 시각아이디문제언어결과실행 시간메모리
603745CyberCow카니발 티켓 (IOI20_tickets)C++17
컴파일 에러
0 ms0 KiB
#include "tickets.h" #include <vector> using namespace std; using ll = long long; ll qaq(vector<int> qaqa) { ll polni = 0; for (int i = 0; i < qaqa.size(); i++) { ll chsh = 0; for (int j = 0; j < qaqa.size(); j++) { chsh += abs(qaqa[i] - qaqa[j]); } polni = max(polni, chsh); } return polni; } long long find_maximum(int k, vector<vector<int>> x) { int n = x.size(); int m = x[0].size(); vector<vector<int>> answer; for (int i = 0; i < n; i++) { vector<int> row(m); answer.push_back(row); } allocate_tickets(answer); return qaq(x[0]); }

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

tickets.cpp: In function 'll qaq(std::vector<int>)':
tickets.cpp:9:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  for (int i = 0; i < qaqa.size(); i++)
      |                  ~~^~~~~~~~~~~~~
tickets.cpp:12:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |   for (int j = 0; j < qaqa.size(); j++)
      |                   ~~^~~~~~~~~~~~~
tickets.cpp:14:12: error: 'abs' was not declared in this scope
   14 |    chsh += abs(qaqa[i] - qaqa[j]);
      |            ^~~