# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
128098 | ekrem | Detecting Molecules (IOI16_molecules) | C++98 | 82 ms | 6380 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>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define sol (k+k)
#define sag (k+k+1)
#define orta ((bas+son)/2)
#define coc g[node][i]
#define mod 1000000007
#define inf 1000000009
#define N 1000005
using namespace std;
typedef long long ll;
typedef pair < int , int > ii;
typedef vector < int > vi;
int n;
vector < ii > x;
vi find_subset(int l, int u, vi w) {
vi ans;
for(int i = 0; i < w.size(); i++)
x.pb(mp(w[i], i));
sort(x.begin(), x.end());
sort(w.begin(), w.end());
// for(int i = 0; i < w.size(); i++)cout << w[i] << " ";cout << endl;
ll top = 0, bas = 0;
for(int i = 0; i < w.size(); i++){
top += w[i];
while(top > u){
top -= w[bas];
bas++;
}
// cout << bas << " " << i << " = " << top << endl;
if(top >= l and top <= u){
for(int j = bas; j <= i; j++)
ans.pb(x[j].nd);
return ans;
}
}
return ans;
}
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... |