# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
942496 | attky | Detecting Molecules (IOI16_molecules) | C++17 | 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.
#include <bits/stdc++.h>
using namespace std;
int * find_subset(int l, int u, int * w) {
int n = sizeof(w) / sizeof(int);
sort(w, w + n);
for(int loop = 1; loop <= n; ++loop) {
if(l <= w[0]*loop && w[0]*loop <= u) {
int tab[loop];
for(int looping = 0; looping < loop; ++looping) {
tab[looping] = w[0];
}
return tab;
}
}
int t[0];
return t;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n, l, u;
cin >> n >> l >> u;
int w[n];
for(int loop = 0; loop < n; ++loop) {
cin >> w[loop];
}
int* sortie = find_subset(l, u, w);
int m = sizeof(sortie) / sizeof(int);
for(int loop = 0; loop < m; ++loop) {
cout << sortie[loop];
}
}