Submission #519794

#TimeUsernameProblemLanguageResultExecution timeMemory
519794yhlasDetecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include "bits/stdc++.h" using namespace std; vector<int> find_subset(int x, int y, vector<int> v){ int n, e, l, r, md, jog; vector<int> a,d; map <int, long long> p; vector <pair <int, int>> u; n = v.size(); for (int i = 0; i < n; i++) u.push_back({v[i], i}); sort(u.begin(), u.end()); for (int i = 0; i < n; i++) p[i] = p[i - 1] + u[i].first; for (int i = 0; i < n; i++){ l = i; r = n - 1; jog = -1; while (l <= r){ md = (l + r) / 2; if (y < p[md] - p[i - 1]) r = md - 1; else if (x > p[md] - p[i - 1]) l = md + 1; else{ e = i; jog = md; break; } } if (jog != -1) break; } for (int i = e; i <= jog; i++) a.push_back(u[i].second); sort(a.begin(), a.end()); return a; }#include "bits/stdc++.h" using namespace std; vector<int> find_subset(int x, int y, vector<int> v){ int n, e, l, r, md, jog; vector<int> a,d; map <int, long long> p; vector <pair <int, int>> u; n = v.size(); for (int i = 0; i < n; i++) u.push_back({v[i], i}); sort(u.begin(), u.end()); for (int i = 0; i < n; i++) p[i] = p[i - 1] + u[i].first; for (int i = 0; i < n; i++){ l = i; r = n - 1; jog = -1; while (l <= r){ md = (l + r) / 2; if (y < p[md] - p[i - 1]) r = md - 1; else if (x > p[md] - p[i - 1]) l = md + 1; else{ e = i; jog = md; break; } } if (jog != -1) break; } for (int i = e; i <= jog; i++) a.push_back(u[i].second); sort(a.begin(), a.end()); return a; }

Compilation message (stderr)

molecules.cpp:30:2: error: stray '#' in program
   30 | }#include "bits/stdc++.h"
      |  ^
molecules.cpp:30:3: error: 'include' does not name a type
   30 | }#include "bits/stdc++.h"
      |   ^~~~~~~
molecules.cpp:33:13: error: redefinition of 'std::vector<int> find_subset(int, int, std::vector<int>)'
   33 | vector<int> find_subset(int x, int y, vector<int> v){
      |             ^~~~~~~~~~~
molecules.cpp:4:13: note: 'std::vector<int> find_subset(int, int, std::vector<int>)' previously defined here
    4 | vector<int> find_subset(int x, int y, vector<int> v){
      |             ^~~~~~~~~~~