Submission #94015

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
940152019-01-14 16:41:29tincamateiFlood (IOI07_flood)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
bool examine(long long l, long long c, int n) {
string str;
if(l < 1 || l > n || c < 1 || c > n)
return false;
cout << "examine " << l << ' ' << c << endl;
cin >> str;
return str == "true";
}
pair<long long, long long> getNextWhite(long long l, long long c, int dl, int dc, int n) {
int lg = 0;
while(examine(l + dl * (1LL << lg), c + dc * (1LL << lg), n))
++lg;
long long l2 = l + dl * (1 << lg), c2 = c + dc * (1 << lg);
while(llabs(c2 - c) > 1 || llabs(l2 - l) > 1) {
long long midl, midc;
midl = (l + l2) / 2;
midc = (c + c2) / 2;
if(examine(midl, midc, n)) {
l = midl;
c = midc;
} else {
l2 = midl;
c2 = midc;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

flood.cpp: In function 'int main()':
flood.cpp:40:3: error: expected initializer before 'long'
   long long maxx, maxy, minx, miny;
   ^~~~
flood.cpp:43:20: error: 'y' was not declared in this scope
   cin >> n >> x >> y;
                    ^
flood.cpp:53:3: error: 'maxx' was not declared in this scope
   maxx = maxy = -(1LL << 60);
   ^~~~
flood.cpp:53:3: note: suggested alternative: 'main'
   maxx = maxy = -(1LL << 60);
   ^~~~
   main
flood.cpp:53:10: error: 'maxy' was not declared in this scope
   maxx = maxy = -(1LL << 60);
          ^~~~
flood.cpp:53:10: note: suggested alternative: 'main'
   maxx = maxy = -(1LL << 60);
          ^~~~
          main
flood.cpp:54:3: error: 'minx' was not declared in this scope
   minx = miny =   1LL << 60;
   ^~~~
flood.cpp:54:3: note: suggested alternative: 'main'
   minx = miny =   1LL << 60;
   ^~~~
   main
flood.cpp:54:10: error: 'miny' was not declared in this scope
   minx = miny =   1LL << 60;
          ^~~~
flood.cpp:54:10: note: suggested alternative: 'main'
   minx = miny =   1LL << 60;
          ^~~~
          main