# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
299468 | 2020-09-15T01:32:37 Z | nicholask | Detecting Molecules (IOI16_molecules) | C++14 | 1 ms | 256 KB |
#include "molecules.h" #include <bits/stdc++.h> using namespace std; vector <int> find_subset(int l,int u,vector<int> w){ int n=w.size(); pair <int,int> a[n]; for (int i=0; i<n; i++){ cin>>a[i].first; a[i].second=i; } sort(a,a+n); long long sum=0,st=0; for (int i=0; i<n; i++){ sum+=a[i].first; while (sum>u) sum-=a[st++].first; if (sum>=l){ vector <int> ans; for (int j=st; j<=i; j++) ans.push_back(a[j].second); return ans; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Integer 10 violates the range [0, 0] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Integer 302 violates the range [0, 11] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Integer 10 violates the range [0, 0] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Integer 10 violates the range [0, 0] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Integer 10 violates the range [0, 0] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 256 KB | Integer 10 violates the range [0, 0] |
2 | Halted | 0 ms | 0 KB | - |