Submission #875704

#TimeUsernameProblemLanguageResultExecution timeMemory
875704nasir_bashirovDetecting Molecules (IOI16_molecules)C++11
0 / 100
1 ms600 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; #define db long double #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vl vector<ll> #define vii vector<pii> #define vll vector<pll> #define endl '\n' #define all(x) x.begin(), x.end() #define fastio\ ios_base::sync_with_stdio(0);\ cin.tie(0);\ cout.tie(0)\ vi find_subset(int x, int y, vi w) { sort(all(w)); vi org = w; int s = 0, l = 0; for(int i = 0; i < w.size(); i++){ s += w[i]; while(l < i and s > y){ s -= w[l]; l++; } if(s >= x and s <= y){ vi res; map<int, int> cnt; for(int j = l; j <= i; j++) cnt[w[j]]++; for(int j = 0; j < w.size(); j++){ if(cnt[org[j]]) res.push_back(j); } return res; } } vi res; return res; }

Compilation message (stderr)

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