제출 #331625

#제출 시각아이디문제언어결과실행 시간메모리
331625pggpCarnival Tickets (IOI20_tickets)C++14
11 / 100
2 ms748 KiB
#include <bits/stdc++.h> #include "tickets.h" using namespace std; void allocate_tickets(vector < vector < int > > s); long long find_maximum(int k, vector < vector < int > > x){ vector < vector < int > > to_allocate; vector < int > v; for(vector < int > t : x){ vector < int > a; to_allocate.push_back(a); for(int i : t){ to_allocate[to_allocate.size() - 1].push_back(0); v.push_back(i); } } allocate_tickets(to_allocate); sort(v.begin(), v.end()); long long ans = 0; for (int i = 0; i < v.size(); ++i) { if(i < v.size() / 2){ ans -= v[i]; } else{ ans += v[i]; } } return ans; }

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:23:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |  for (int i = 0; i < v.size(); ++i)
      |                  ~~^~~~~~~~~~
tickets.cpp:25:8: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |   if(i < v.size() / 2){
      |      ~~^~~~~~~~~~~~~~
#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...