# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
818936 | Gangsta | Detecting Molecules (IOI16_molecules) | C++14 | 0 ms | 0 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.
/*
ID: didarco1
LANG: C++17
TASK:
*/
// a >> b = a / pow(2,b)
// a << b = a * pow(2,b)
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define sz size()
#define ss second
#define ff first
#define N 200001
#define pii pair<int,int>
using namespace std;
//ll _, x, n;
int[] find_subset(int l, int u, int w[])
int x = w[0], uly = 0, kici = 0, den = 0, sum = 0, n = sizeof(w);
for(int i = 1; i < n; i++){
if(w[i] == x + 1) uly++;
else if(w[i] == x - 1) kici++;
else if(w[i] == x) den++;
}
if(den + 1 == n){
for(int i = 0; i < n; i++){
sum += w[i];
result[i] = w[i];
if(sum >= l and sum <= u) return result;
}
for(int i = 0; i < n; i++) result[i] = 0;
return result;
}
return result;
}