제출 #779387

#제출 시각아이디문제언어결과실행 시간메모리
779387JoenPoenManDetecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms300 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; #define fullVec(arr) arr.begin(), arr.end() typedef pair<int, int> ii; std::vector<int> find_subset(int l, int u, std::vector<int> w) { vector<int> subset; vector<ii> sw; for (int i = 0; i < w.size(); i++) { sw.push_back({w[i], i}); } sort(fullVec(sw)); int sum = 0; for (int i = sw.size()-1; i >= 0; i--) { if (u-sw[i].first >= sw[0].first) { subset.push_back(sw[i].second); sum += sw[i].first; if (sum >= l) return subset; } } return std::vector<int>(0); }

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

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