Submission #1251095

#TimeUsernameProblemLanguageResultExecution timeMemory
1251095guardianecDetecting Molecules (IOI16_molecules)C++20
Compilation error
0 ms0 KiB
#include <"molecules.h">
#include <bits/stdc++.h>
#define ll long long
using namespace std;

vector<int> ans,v;
ll lo,hi;

vector<int> find_subset(int l, int u, vector<int> w){
    for (int i=0; i<w.size(); i++){
        v.push_back(i);
    }
    sort(v.begin(), v.end(), [&](int a, int b){
        return w[a]<w[b];
    });
    for (int i=0; i<w.size(); i++){
        lo+=w[v[i]]; hi+=w[v[w.size()-i-1]];
        if (hi>=l && lo<=u){
            int j = i;
            while(l>lo) {
                lo = lo - w[v[j-i]] + w[v[j+1]];
                j++;
            }
            for (int k=j-i; k<=j; k++){
                ans.push_back(v[k]);
            }
            return ans;
        }
    }
    return ans;
}

Compilation message (stderr)

molecules.cpp:1:10: fatal error: "molecules.h": No such file or directory
    1 | #include <"molecules.h">
      |          ^~~~~~~~~~~~~~~
compilation terminated.
molecules.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
molecules_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~