Submission #386574

#TimeUsernameProblemLanguageResultExecution timeMemory
386574Christopher_RdzDetecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++-h> using namespace std; struct datos{ int valor; int id; }; const bool operator <(const datos&a, const datos&b){ return a.valor < b.valor; } datos arre[200005]; std::vector<int> find_subset(int l, int u, std::vector<int> w) { int tam = w.size(); for (int i = 0; i < tam; i++){ arre[i].valor = w[i]; arre[i].id = i; } sort(arre + 0, arre + tam); int ini = 0, fin = 0, mayor, menor; long long int suma = 0; if (l > u){ mayor = l; menor = u; }else{ mayor = u; menor = l; } bool puede = false; while (fin <= tam){ if (suma < menor){ suma += arre[fin].valor; fin++; }else{ if (suma > mayor){ suma -= arre[ini].valor; ini++; }else{ if (suma >= menor and suma <= mayor){ puede = true; break; } } } } vector <int> res; if (puede){ suma = 0; for (int i = ini; i <= fin; i++){ if (suma < menor){ res.push_back(arre[i].id); suma += arre[i].valor; } } } return res; }

Compilation message (stderr)

molecules.cpp:2:10: fatal error: bits/stdc++-h: No such file or directory
    2 | #include <bits/stdc++-h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.