제출 #198110

#제출 시각아이디문제언어결과실행 시간메모리
198110Ruxandra985Detecting Molecules (IOI16_molecules)C++14
0 / 100
2 ms380 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; vector <int> sol; pair <int,int> x[200010]; vector <int> find_subset (int l , int u , vector <int> v){ int i , sum; for (i=0;i<v.size();i++){ x[i] = make_pair(v[i] , i); } sort (x + 1 , x + v.size()); sum = 0; for (i = v.size() - 1 ; i ;i--){ if (sum + x[i].first <= u){ sum += x[i].first; sol.push_back(x[i].second); } if (sum >= l){ return sol; } } sol.clear(); return sol; /// nu se poate; }

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

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:9:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i=0;i<v.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...