# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
205370 | 2020-02-28T17:44:11 Z | oko | Detecting Molecules (IOI16_molecules) | C++14 | 1000 ms | 376 KB |
#include <cstdio> #include <vector> #include <cassert> #include<bits/stdc++.h> #include "molecules.h" using namespace std; long long a,b,sum; vector<pair<int,int> >v; vector<int> find_subset(int l, int u, std::vector<int> w) { for(int i=0;i<w.size();i++)v.push_back({w[i],i}); sort(v.begin(),v.end()); vector<int>ans; while(a<v.size()) { if(sum<l&&b<v.size()) { sum+=v[b].first; b++; } else if(u<sum) { sum-=v[a].first; a++; } if(l<=sum&&sum<=u) { for(int i=a;i<b;i++)ans.push_back(v[i].second); return ans; } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1091 ms | 256 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | OK (n = 12, answer = YES) |
2 | Correct | 5 ms | 376 KB | OK (n = 12, answer = YES) |
3 | Execution timed out | 1089 ms | 256 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1091 ms | 256 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1091 ms | 256 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1091 ms | 256 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1091 ms | 256 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |