# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
875705 | nasir_bashirov | Detecting Molecules (IOI16_molecules) | C++11 | 1 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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), cnt[org[j]]--;
}
return res;
}
}
vi res;
return res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |