carnival.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
carnival.java:1: error: class, interface, or enum expected
#include <bits/stdc++.h>
^
carnival.java:2: error: illegal character: '#'
#define ll long long
^
carnival.java:5: error: class, interface, or enum expected
ll n, l, r;
^
carnival.java:6: error: class, interface, or enum expected
ll ask(ll l, ll r)
^
carnival.java:9: error: class, interface, or enum expected
int res;
^
carnival.java:10: error: class, interface, or enum expected
cin >> res;
^
carnival.java:11: error: class, interface, or enum expected
return res;
^
carnival.java:12: error: class, interface, or enum expected
}
^
carnival.java:16: error: class, interface, or enum expected
l = 1, r = n;
^
carnival.java:17: error: class, interface, or enum expected
while(l < r)
^
carnival.java:20: error: class, interface, or enum expected
ll ans2 = ask(l+1,r);
^
carnival.java:21: error: class, interface, or enum expected
ll ans3 = ask(l,r-1);
^
carnival.java:22: error: class, interface, or enum expected
if(ans1 == ans2 and ans1 == ans3)
^
carnival.java:25: error: class, interface, or enum expected
l++;
^
carnival.java:26: error: class, interface, or enum expected
}
^
carnival.java:30: error: class, interface, or enum expected
return 0;
^
carnival.java:31: error: class, interface, or enum expected
}
^
carnival.java:35: error: class, interface, or enum expected
return 0;
^
carnival.java:36: error: class, interface, or enum expected
}
^
carnival.java:39: error: class, interface, or enum expected
}
^
21 errors