제출 #668373

#제출 시각아이디문제언어결과실행 시간메모리
668373haxormanDetecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms304 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; vector<int> find_subset(int l, int r, vector<int> arr) { vector<pair<int,int>> vec; for (int i = 0; i < arr.size(); ++i) { vec.push_back({arr[i], i + 1}); } sort(vec.begin(), vec.end()); long long sum = 0; set<pair<int,int>> check; for (int i = 0; i < vec.size(); ++i) { while (sum > r) { sum -= (*check.rbegin()).first; check.erase(*check.rbegin()); } if (sum >= l) { vector<int> ans; for (auto p : check) { ans.push_back(p.second); } return ans; } } return {}; }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:7:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |     for (int i = 0; i < arr.size(); ++i) {
      |                     ~~^~~~~~~~~~~~
molecules.cpp:14:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |     for (int i = 0; i < vec.size(); ++i) {
      |                     ~~^~~~~~~~~~~~
#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...