Submission #529342

#TimeUsernameProblemLanguageResultExecution timeMemory
529342kevinDetecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define all(x) x.begin(), x.end() #define f first #define s second #define ca(v) for(auto i:v) cout<<i<<" "; #define nl cout<<"\n" const int MOD = 1e9 + 7; vector<int> find_subset(int l, int r, vector<int> ar){ sort(all(ar)); int n = ar.size(); ll sm = 0; int p = 0; vector<int> emp = {}; if(ar[0] > l) return emp; for(int i=0; i<n; i++){ if(ar[i] + sm > r) break; sm += ar[i]; p = i; } for(int i=0; i<n; i++){ if(sm >= l && sm <= r){ vector<int> out = {}; for(int j=i; j<=p+i; j++){ out.push_back(j); } return out; } if(i + 1 + p >= n) break; sm -= ar[i]; sm += ar[i+p+1]; } return emp; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...