Submission #553223

#TimeUsernameProblemLanguageResultExecution timeMemory
553223sandry24Detecting Molecules (IOI16_molecules)C++17
0 / 100
0 ms212 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pi; #define pb push_back #define mp make_pair #define f first #define s second vi find_subset(int l, int u, vi w){ sort(w.begin(), w.end(), greater<int>()); ll sum = 0; int ind = 0; vector<int> visited(w.size()); while(ind != w.size()){ if(sum + w[ind] < l){ sum += w[l]; visited[ind] = 1; } ind++; } vi ans; for(int i = 0; i < w.size(); i++){ if(!visited[i]){ sum += w[i]; visited[ind] = 1; break; } } if(sum >= l && sum <= u){ for(int i = 0; i < w.size(); i++){ if(visited[i]) ans.pb(i); } } return ans; }

Compilation message (stderr)

molecules.cpp: In function 'vi find_subset(int, int, vi)':
molecules.cpp:17:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     while(ind != w.size()){
      |           ~~~~^~~~~~~~~~~
molecules.cpp:25:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |     for(int i = 0; i < w.size(); i++){
      |                    ~~^~~~~~~~~~
molecules.cpp:33:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |         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...