Submission #403288

#TimeUsernameProblemLanguageResultExecution timeMemory
403288Leonardo_PaesDetecting Molecules (IOI16_molecules)C++17
9 / 100
1 ms236 KiB
#include <bits/stdc++.h> using namespace std; vector<int> find_subset(int ll, int u, vector<int> v){ vector<int> ans; sort(v.begin(), v.end()); int l = 0; long long sum = 0; for(int r=0; r<v.size(); r++){ sum += v[r]; while(sum > u) sum -= v[l++]; if(ll <= sum and sum <= u){ while(l <= r) ans.push_back(l++); break; } } return ans; }

Compilation message (stderr)

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