gw.java:1: error: illegal character: '#'
#include <iostream>
^
gw.java:1: error: class, interface, or enum expected
#include <iostream>
^
gw.java:2: error: illegal character: '#'
#include <vector>
^
gw.java:3: error: illegal character: '#'
#include <algorithm>
^
gw.java:4: error: illegal character: '#'
#include <fstream>
^
gw.java:8: error: illegal start of type
private:
^
gw.java:10: error: illegal start of type
public:
^
gw.java:13: error: ';' expected
Element(int val, int ind) : val(val), ind(ind) {}
^
gw.java:14: error: ';' expected
bool operator<(const Element& o) const {
^
gw.java:14: error: <identifier> expected
bool operator<(const Element& o) const {
^
gw.java:14: error: illegal start of type
bool operator<(const Element& o) const {
^
gw.java:19: error: class, interface, or enum expected
bool funt(int mid, std::vector<Element>& T) {
^
gw.java:21: error: class, interface, or enum expected
int index = 0;
^
gw.java:22: error: class, interface, or enum expected
std::vector<bool> v(T.size(), false);
^
gw.java:23: error: class, interface, or enum expected
while (islands < mid && index < T.size()) {
^
gw.java:25: error: class, interface, or enum expected
while (index < T.size() && T[index].val == currVal) {
^
gw.java:27: error: class, interface, or enum expected
v[curr.ind] = true;
^
gw.java:28: error: class, interface, or enum expected
bool left = curr.ind == 0 || !v[curr.ind - 1];
^
gw.java:29: error: class, interface, or enum expected
bool right = curr.ind == v.size() - 1 || !v[curr.ind + 1];
^
gw.java:30: error: class, interface, or enum expected
if (left && right) islands++;
^
gw.java:31: error: class, interface, or enum expected
bool negLeft = curr.ind != 0 && v[curr.ind - 1];
^
gw.java:32: error: class, interface, or enum expected
bool negRight = curr.ind != v.size() - 1 && v[curr.ind + 1];
^
gw.java:33: error: class, interface, or enum expected
if (negLeft && negRight) islands--;
^
gw.java:34: error: class, interface, or enum expected
index++;
^
gw.java:35: error: class, interface, or enum expected
}
^
gw.java:38: error: class, interface, or enum expected
}
^
gw.java:42: error: class, interface, or enum expected
int hi = T.size();
^
gw.java:43: error: class, interface, or enum expected
while (lo < hi) {
^
gw.java:45: error: class, interface, or enum expected
if (funt(mid, T)) {
^
gw.java:47: error: class, interface, or enum expected
} else {
^
gw.java:49: error: class, interface, or enum expected
}
^
gw.java:52: error: class, interface, or enum expected
}
^
gw.java:56: error: class, interface, or enum expected
std::cin.tie(nullptr);
^
gw.java:57: error: class, interface, or enum expected
int N;
^
gw.java:58: error: class, interface, or enum expected
std::cin >> N;
^
gw.java:59: error: class, interface, or enum expected
std::vector<Element> Arr;
^
gw.java:60: error: class, interface, or enum expected
for (int i = 0; i < N; i++) {
^
gw.java:60: error: class, interface, or enum expected
for (int i = 0; i < N; i++) {
^
gw.java:60: error: class, interface, or enum expected
for (int i = 0; i < N; i++) {
^
gw.java:62: error: class, interface, or enum expected
std::cin >> value;
^
gw.java:63: error: class, interface, or enum expected
Arr.emplace_back(value, i);
^
gw.java:64: error: class, interface, or enum expected
}
^
gw.java:66: error: class, interface, or enum expected
std::cout << bs(Arr) << std::endl;
^
gw.java:67: error: class, interface, or enum expected
return 0;
^
gw.java:68: error: class, interface, or enum expected
}
^
45 errors