# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1162344 | tsengang | Detecting Molecules (IOI16_molecules) | C++20 | 0 ms | 328 KiB |
#include <bits/stdc++.h>
#include "molecules.h"
using namespace std;
#define ll long long
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define ertunt return
const int mod = 998244353;
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
vector<int>find_subset(int l, int u, vector<int>w){
sort(all(w));
int n = w.size();
ll cur = 0;
vector<int> ans;
ll j = 0;
while(j < n and cur + w[j] <= u){
cur+=w[j];
j++;
}
if(j == 0)ertunt ans;
if(cur >= l){
vector<int>c(j);
iota(all(c),0);
}
int lst = n-1;
int i = 0;
while(lst >= j){
if(cur >= l)break;
cur+= w[lst] - w[i];
i++;
lst++;
ans.pb(lst+1);
}
if(cur >= l){
for(; i < j; i++)ans.pb(i);
ertunt ans;
}
else{
vector<int>c;
ertunt c;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |